@jupyterlab/notebook-extension 4.5.0-alpha.0 → 4.5.0-alpha.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/lib/index.js +909 -92
- package/lib/index.js.map +1 -1
- package/package.json +32 -31
- package/src/index.ts +990 -91
- package/style/index.css +2 -2
- package/style/index.js +2 -2
package/lib/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import { JSONExt, UUID } from '@lumino/coreutils';
|
|
|
33
33
|
import { DisposableSet } from '@lumino/disposable';
|
|
34
34
|
import { MessageLoop } from '@lumino/messaging';
|
|
35
35
|
import { Panel } from '@lumino/widgets';
|
|
36
|
+
import { CellBarExtension } from '@jupyterlab/cell-toolbar';
|
|
36
37
|
import { cellExecutor } from './cellexecutor';
|
|
37
38
|
import { logNotebookOutput } from './nboutput';
|
|
38
39
|
import { ActiveCellTool } from './tool-widgets/activeCellToolWidget';
|
|
@@ -373,7 +374,27 @@ export const exportPlugin = {
|
|
|
373
374
|
}
|
|
374
375
|
return (_b = (_a = services.nbconvert).exportAs) === null || _b === void 0 ? void 0 : _b.call(_a, exportOptions);
|
|
375
376
|
},
|
|
376
|
-
isEnabled
|
|
377
|
+
isEnabled,
|
|
378
|
+
describedBy: {
|
|
379
|
+
args: {
|
|
380
|
+
type: 'object',
|
|
381
|
+
properties: {
|
|
382
|
+
format: {
|
|
383
|
+
type: 'string',
|
|
384
|
+
description: trans.__('The export format (e.g., pdf, html, latex)')
|
|
385
|
+
},
|
|
386
|
+
label: {
|
|
387
|
+
type: 'string',
|
|
388
|
+
description: trans.__('The label to display for this format')
|
|
389
|
+
},
|
|
390
|
+
isPalette: {
|
|
391
|
+
type: 'boolean',
|
|
392
|
+
description: trans.__('Whether the command is called from the command palette')
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
required: ['format']
|
|
396
|
+
}
|
|
397
|
+
}
|
|
377
398
|
});
|
|
378
399
|
// Add a notebook group to the File menu.
|
|
379
400
|
let exportTo;
|
|
@@ -927,7 +948,22 @@ function activateClonedOutputs(app, docManager, notebookTracker, translator, res
|
|
|
927
948
|
widget.dispose();
|
|
928
949
|
});
|
|
929
950
|
},
|
|
930
|
-
isEnabled: isEnabledAndSingleSelected
|
|
951
|
+
isEnabled: isEnabledAndSingleSelected,
|
|
952
|
+
describedBy: {
|
|
953
|
+
args: {
|
|
954
|
+
type: 'object',
|
|
955
|
+
properties: {
|
|
956
|
+
path: {
|
|
957
|
+
type: 'string',
|
|
958
|
+
description: trans.__('The path to the notebook containing the cell')
|
|
959
|
+
},
|
|
960
|
+
index: {
|
|
961
|
+
type: 'number',
|
|
962
|
+
description: trans.__('The index of the cell to create an output view for')
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}
|
|
931
967
|
});
|
|
932
968
|
}
|
|
933
969
|
/**
|
|
@@ -946,7 +982,18 @@ function activateCodeConsole(app, tracker, translator) {
|
|
|
946
982
|
}
|
|
947
983
|
return Private.createConsole(commands, current, args['activate']);
|
|
948
984
|
},
|
|
949
|
-
isEnabled
|
|
985
|
+
isEnabled,
|
|
986
|
+
describedBy: {
|
|
987
|
+
args: {
|
|
988
|
+
type: 'object',
|
|
989
|
+
properties: {
|
|
990
|
+
activate: {
|
|
991
|
+
type: 'boolean',
|
|
992
|
+
description: trans.__('Whether to activate the console after creation')
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
950
997
|
});
|
|
951
998
|
commands.addCommand(CommandIDs.createSubshellConsole, {
|
|
952
999
|
label: trans.__('New Subshell Console for Notebook'),
|
|
@@ -962,6 +1009,17 @@ function activateCodeConsole(app, tracker, translator) {
|
|
|
962
1009
|
var _a, _b, _c;
|
|
963
1010
|
const kernel = (_b = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.context.sessionContext.session) === null || _b === void 0 ? void 0 : _b.kernel;
|
|
964
1011
|
return (_c = kernel === null || kernel === void 0 ? void 0 : kernel.supportsSubshells) !== null && _c !== void 0 ? _c : false;
|
|
1012
|
+
},
|
|
1013
|
+
describedBy: {
|
|
1014
|
+
args: {
|
|
1015
|
+
type: 'object',
|
|
1016
|
+
properties: {
|
|
1017
|
+
activate: {
|
|
1018
|
+
type: 'boolean',
|
|
1019
|
+
description: trans.__('Whether to activate the console after creation')
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
965
1023
|
}
|
|
966
1024
|
});
|
|
967
1025
|
commands.addCommand(CommandIDs.runInConsole, {
|
|
@@ -1076,7 +1134,13 @@ function activateCodeConsole(app, tracker, translator) {
|
|
|
1076
1134
|
metadata
|
|
1077
1135
|
});
|
|
1078
1136
|
},
|
|
1079
|
-
isEnabled
|
|
1137
|
+
isEnabled,
|
|
1138
|
+
describedBy: {
|
|
1139
|
+
args: {
|
|
1140
|
+
type: 'object',
|
|
1141
|
+
properties: {}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1080
1144
|
});
|
|
1081
1145
|
}
|
|
1082
1146
|
/**
|
|
@@ -1123,6 +1187,12 @@ function activateCopyOutput(app, translator, tracker) {
|
|
|
1123
1187
|
const area = outputAreaAreas[0];
|
|
1124
1188
|
copyElement(area);
|
|
1125
1189
|
}
|
|
1190
|
+
},
|
|
1191
|
+
describedBy: {
|
|
1192
|
+
args: {
|
|
1193
|
+
type: 'object',
|
|
1194
|
+
properties: {}
|
|
1195
|
+
}
|
|
1126
1196
|
}
|
|
1127
1197
|
});
|
|
1128
1198
|
app.contextMenu.addItem({
|
|
@@ -1222,7 +1292,18 @@ function activateNotebookHandler(app, factory, extensions, executor, palette, de
|
|
|
1222
1292
|
isToggled: () => ['codeCellConfig', 'markdownCellConfig', 'rawCellConfig'].some(x => {
|
|
1223
1293
|
var _a;
|
|
1224
1294
|
return ((_a = settings.get(x).composite.autoClosingBrackets) !== null && _a !== void 0 ? _a : extensions.baseConfiguration['autoClosingBrackets']) === true;
|
|
1225
|
-
})
|
|
1295
|
+
}),
|
|
1296
|
+
describedBy: {
|
|
1297
|
+
args: {
|
|
1298
|
+
type: 'object',
|
|
1299
|
+
properties: {
|
|
1300
|
+
force: {
|
|
1301
|
+
type: 'boolean',
|
|
1302
|
+
description: trans.__('Force toggling the auto closing brackets setting')
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1226
1307
|
});
|
|
1227
1308
|
commands.addCommand(CommandIDs.setSideBySideRatio, {
|
|
1228
1309
|
label: trans.__('Set side-by-side ratio'),
|
|
@@ -1238,6 +1319,12 @@ function activateNotebookHandler(app, factory, extensions, executor, palette, de
|
|
|
1238
1319
|
}
|
|
1239
1320
|
})
|
|
1240
1321
|
.catch(console.error);
|
|
1322
|
+
},
|
|
1323
|
+
describedBy: {
|
|
1324
|
+
args: {
|
|
1325
|
+
type: 'object',
|
|
1326
|
+
properties: {}
|
|
1327
|
+
}
|
|
1241
1328
|
}
|
|
1242
1329
|
});
|
|
1243
1330
|
addCommands(app, tracker, translator, sessionDialogs, settings, isEnabled);
|
|
@@ -1421,6 +1508,37 @@ function activateNotebookHandler(app, factory, extensions, executor, palette, de
|
|
|
1421
1508
|
const kernelId = args['kernelId'] || '';
|
|
1422
1509
|
const kernelName = args['kernelName'] || '';
|
|
1423
1510
|
return createNew(cwd, kernelId, kernelName);
|
|
1511
|
+
},
|
|
1512
|
+
describedBy: {
|
|
1513
|
+
args: {
|
|
1514
|
+
type: 'object',
|
|
1515
|
+
properties: {
|
|
1516
|
+
cwd: {
|
|
1517
|
+
type: 'string',
|
|
1518
|
+
description: trans.__('Current working directory for the new notebook')
|
|
1519
|
+
},
|
|
1520
|
+
kernelId: {
|
|
1521
|
+
type: 'string',
|
|
1522
|
+
description: trans.__('Kernel ID to use for the new notebook')
|
|
1523
|
+
},
|
|
1524
|
+
kernelName: {
|
|
1525
|
+
type: 'string',
|
|
1526
|
+
description: trans.__('Kernel name to use for the new notebook')
|
|
1527
|
+
},
|
|
1528
|
+
isLauncher: {
|
|
1529
|
+
type: 'boolean',
|
|
1530
|
+
description: trans.__('Whether the command is executed from launcher')
|
|
1531
|
+
},
|
|
1532
|
+
isPalette: {
|
|
1533
|
+
type: 'boolean',
|
|
1534
|
+
description: trans.__('Whether the command is executed from palette')
|
|
1535
|
+
},
|
|
1536
|
+
isContextMenu: {
|
|
1537
|
+
type: 'boolean',
|
|
1538
|
+
description: trans.__('Whether the command is executed from context menu')
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1424
1542
|
}
|
|
1425
1543
|
});
|
|
1426
1544
|
// Add a launcher item if the launcher is available.
|
|
@@ -1476,6 +1594,17 @@ function activateNotebookCompleterService(app, notebooks, manager, translator, a
|
|
|
1476
1594
|
if (panel && ((_a = panel.content.activeCell) === null || _a === void 0 ? void 0 : _a.model.type) === 'code') {
|
|
1477
1595
|
manager.invoke(panel.id);
|
|
1478
1596
|
}
|
|
1597
|
+
},
|
|
1598
|
+
describedBy: {
|
|
1599
|
+
args: {
|
|
1600
|
+
type: 'object',
|
|
1601
|
+
properties: {
|
|
1602
|
+
activate: {
|
|
1603
|
+
type: 'boolean',
|
|
1604
|
+
description: trans.__('Whether to activate the widget')
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1479
1608
|
}
|
|
1480
1609
|
});
|
|
1481
1610
|
app.commands.addCommand(CommandIDs.selectCompleter, {
|
|
@@ -1485,6 +1614,17 @@ function activateNotebookCompleterService(app, notebooks, manager, translator, a
|
|
|
1485
1614
|
if (id) {
|
|
1486
1615
|
return manager.select(id);
|
|
1487
1616
|
}
|
|
1617
|
+
},
|
|
1618
|
+
describedBy: {
|
|
1619
|
+
args: {
|
|
1620
|
+
type: 'object',
|
|
1621
|
+
properties: {
|
|
1622
|
+
activate: {
|
|
1623
|
+
type: 'boolean',
|
|
1624
|
+
description: trans.__('Whether to activate the widget')
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1488
1628
|
}
|
|
1489
1629
|
});
|
|
1490
1630
|
app.commands.addKeyBinding({
|
|
@@ -1549,10 +1689,20 @@ function activateNotebookLanguageServer(app, notebooks, connectionManager, featu
|
|
|
1549
1689
|
}
|
|
1550
1690
|
// Get the current widget and activate unless the args specify otherwise.
|
|
1551
1691
|
function getCurrent(tracker, shell, args) {
|
|
1552
|
-
var _a;
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1692
|
+
var _a, _b;
|
|
1693
|
+
let widget = null;
|
|
1694
|
+
// Check for panelId in args (used by cell toolbars)
|
|
1695
|
+
if (args[CellBarExtension.WIDGET_ID_ARG]) {
|
|
1696
|
+
widget =
|
|
1697
|
+
(_a = tracker.find(panel => panel.id === args[CellBarExtension.WIDGET_ID_ARG])) !== null && _a !== void 0 ? _a : null;
|
|
1698
|
+
}
|
|
1699
|
+
else if (args[SemanticCommand.WIDGET]) {
|
|
1700
|
+
widget =
|
|
1701
|
+
(_b = tracker.find(panel => panel.id === args[SemanticCommand.WIDGET])) !== null && _b !== void 0 ? _b : null;
|
|
1702
|
+
}
|
|
1703
|
+
else {
|
|
1704
|
+
widget = tracker.currentWidget;
|
|
1705
|
+
}
|
|
1556
1706
|
const activate = args['activate'] !== false;
|
|
1557
1707
|
if (activate && widget) {
|
|
1558
1708
|
shell.activateById(widget.id);
|
|
@@ -1573,7 +1723,14 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1573
1723
|
var _a, _b;
|
|
1574
1724
|
for (const cell of notebook.widgets) {
|
|
1575
1725
|
if (cell instanceof MarkdownCell && cell.headingCollapsed) {
|
|
1576
|
-
|
|
1726
|
+
cell
|
|
1727
|
+
.getHeadings()
|
|
1728
|
+
.then(() => {
|
|
1729
|
+
NotebookActions.setHeadingCollapse(cell, true, notebook);
|
|
1730
|
+
})
|
|
1731
|
+
.catch(error => {
|
|
1732
|
+
console.warn('Failed to resolve headings: ', error);
|
|
1733
|
+
});
|
|
1577
1734
|
}
|
|
1578
1735
|
if (cell.model.id === ((_b = (_a = notebook.activeCell) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.id)) {
|
|
1579
1736
|
NotebookActions.expandParent(cell, notebook);
|
|
@@ -1636,7 +1793,22 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1636
1793
|
}
|
|
1637
1794
|
},
|
|
1638
1795
|
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
1639
|
-
icon: args => (args.toolbar ? runIcon : undefined)
|
|
1796
|
+
icon: args => (args.toolbar ? runIcon : undefined),
|
|
1797
|
+
describedBy: {
|
|
1798
|
+
args: {
|
|
1799
|
+
type: 'object',
|
|
1800
|
+
properties: {
|
|
1801
|
+
toolbar: {
|
|
1802
|
+
type: 'boolean',
|
|
1803
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
1804
|
+
},
|
|
1805
|
+
activate: {
|
|
1806
|
+
type: 'boolean',
|
|
1807
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1640
1812
|
});
|
|
1641
1813
|
commands.addCommand(CommandIDs.run, {
|
|
1642
1814
|
label: args => {
|
|
@@ -1651,7 +1823,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1651
1823
|
return NotebookActions.run(content, context.sessionContext, sessionDialogs, translator);
|
|
1652
1824
|
}
|
|
1653
1825
|
},
|
|
1654
|
-
isEnabled
|
|
1826
|
+
isEnabled,
|
|
1827
|
+
describedBy: {
|
|
1828
|
+
args: {
|
|
1829
|
+
type: 'object',
|
|
1830
|
+
properties: {
|
|
1831
|
+
activate: {
|
|
1832
|
+
type: 'boolean',
|
|
1833
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1655
1838
|
});
|
|
1656
1839
|
commands.addCommand(CommandIDs.runAndInsert, {
|
|
1657
1840
|
label: args => {
|
|
@@ -1666,7 +1849,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1666
1849
|
return NotebookActions.runAndInsert(content, context.sessionContext, sessionDialogs, translator);
|
|
1667
1850
|
}
|
|
1668
1851
|
},
|
|
1669
|
-
isEnabled
|
|
1852
|
+
isEnabled,
|
|
1853
|
+
describedBy: {
|
|
1854
|
+
args: {
|
|
1855
|
+
type: 'object',
|
|
1856
|
+
properties: {
|
|
1857
|
+
activate: {
|
|
1858
|
+
type: 'boolean',
|
|
1859
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1670
1864
|
});
|
|
1671
1865
|
commands.addCommand(CommandIDs.runAll, {
|
|
1672
1866
|
label: trans.__('Run All Cells'),
|
|
@@ -1678,7 +1872,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1678
1872
|
return NotebookActions.runAll(content, context.sessionContext, sessionDialogs, translator);
|
|
1679
1873
|
}
|
|
1680
1874
|
},
|
|
1681
|
-
isEnabled
|
|
1875
|
+
isEnabled,
|
|
1876
|
+
describedBy: {
|
|
1877
|
+
args: {
|
|
1878
|
+
type: 'object',
|
|
1879
|
+
properties: {}
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1682
1882
|
});
|
|
1683
1883
|
commands.addCommand(CommandIDs.runAllAbove, {
|
|
1684
1884
|
label: trans.__('Run All Above Selected Cell'),
|
|
@@ -1694,6 +1894,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1694
1894
|
// or if we are at the top of the notebook.
|
|
1695
1895
|
return (isEnabledAndSingleSelected() &&
|
|
1696
1896
|
tracker.currentWidget.content.activeCellIndex !== 0);
|
|
1897
|
+
},
|
|
1898
|
+
describedBy: {
|
|
1899
|
+
args: {
|
|
1900
|
+
type: 'object',
|
|
1901
|
+
properties: {}
|
|
1902
|
+
}
|
|
1697
1903
|
}
|
|
1698
1904
|
});
|
|
1699
1905
|
commands.addCommand(CommandIDs.runAllBelow, {
|
|
@@ -1712,6 +1918,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1712
1918
|
(tracker.currentWidget.content.widgets.length === 1 ||
|
|
1713
1919
|
tracker.currentWidget.content.activeCellIndex !==
|
|
1714
1920
|
tracker.currentWidget.content.widgets.length - 1));
|
|
1921
|
+
},
|
|
1922
|
+
describedBy: {
|
|
1923
|
+
args: {
|
|
1924
|
+
type: 'object',
|
|
1925
|
+
properties: {}
|
|
1926
|
+
}
|
|
1715
1927
|
}
|
|
1716
1928
|
});
|
|
1717
1929
|
commands.addCommand(CommandIDs.renderAllMarkdown, {
|
|
@@ -1723,7 +1935,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1723
1935
|
return NotebookActions.renderAllMarkdown(content);
|
|
1724
1936
|
}
|
|
1725
1937
|
},
|
|
1726
|
-
isEnabled
|
|
1938
|
+
isEnabled,
|
|
1939
|
+
describedBy: {
|
|
1940
|
+
args: {
|
|
1941
|
+
type: 'object',
|
|
1942
|
+
properties: {}
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1727
1945
|
});
|
|
1728
1946
|
commands.addCommand(CommandIDs.restart, {
|
|
1729
1947
|
label: trans.__('Restart Kernel…'),
|
|
@@ -1735,7 +1953,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1735
1953
|
}
|
|
1736
1954
|
},
|
|
1737
1955
|
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
1738
|
-
icon: args => (args.toolbar ? refreshIcon : undefined)
|
|
1956
|
+
icon: args => (args.toolbar ? refreshIcon : undefined),
|
|
1957
|
+
describedBy: {
|
|
1958
|
+
args: {
|
|
1959
|
+
type: 'object',
|
|
1960
|
+
properties: {
|
|
1961
|
+
toolbar: {
|
|
1962
|
+
type: 'boolean',
|
|
1963
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1739
1968
|
});
|
|
1740
1969
|
commands.addCommand(CommandIDs.shutdown, {
|
|
1741
1970
|
label: trans.__('Shut Down Kernel'),
|
|
@@ -1746,7 +1975,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1746
1975
|
}
|
|
1747
1976
|
return current.context.sessionContext.shutdown();
|
|
1748
1977
|
},
|
|
1749
|
-
isEnabled
|
|
1978
|
+
isEnabled,
|
|
1979
|
+
describedBy: {
|
|
1980
|
+
args: {
|
|
1981
|
+
type: 'object',
|
|
1982
|
+
properties: {}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1750
1985
|
});
|
|
1751
1986
|
commands.addCommand(CommandIDs.closeAndShutdown, {
|
|
1752
1987
|
label: trans.__('Close and Shut Down Notebook…'),
|
|
@@ -1770,7 +2005,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1770
2005
|
}
|
|
1771
2006
|
});
|
|
1772
2007
|
},
|
|
1773
|
-
isEnabled
|
|
2008
|
+
isEnabled,
|
|
2009
|
+
describedBy: {
|
|
2010
|
+
args: {
|
|
2011
|
+
type: 'object',
|
|
2012
|
+
properties: {}
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
1774
2015
|
});
|
|
1775
2016
|
commands.addCommand(CommandIDs.trust, {
|
|
1776
2017
|
label: () => trans.__('Trust Notebook'),
|
|
@@ -1781,7 +2022,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1781
2022
|
return NotebookActions.trust(content).then(() => context.save());
|
|
1782
2023
|
}
|
|
1783
2024
|
},
|
|
1784
|
-
isEnabled
|
|
2025
|
+
isEnabled,
|
|
2026
|
+
describedBy: {
|
|
2027
|
+
args: {
|
|
2028
|
+
type: 'object',
|
|
2029
|
+
properties: {}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
1785
2032
|
});
|
|
1786
2033
|
commands.addCommand(CommandIDs.restartClear, {
|
|
1787
2034
|
label: trans.__('Restart Kernel and Clear Outputs of All Cells…'),
|
|
@@ -1794,7 +2041,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1794
2041
|
await commands.execute(CommandIDs.clearAllOutputs);
|
|
1795
2042
|
}
|
|
1796
2043
|
},
|
|
1797
|
-
isEnabled
|
|
2044
|
+
isEnabled,
|
|
2045
|
+
describedBy: {
|
|
2046
|
+
args: {
|
|
2047
|
+
type: 'object',
|
|
2048
|
+
properties: {}
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
1798
2051
|
});
|
|
1799
2052
|
commands.addCommand(CommandIDs.restartAndRunToSelected, {
|
|
1800
2053
|
label: trans.__('Restart Kernel and Run up to Selected Cell…'),
|
|
@@ -1810,7 +2063,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1810
2063
|
return NotebookActions.runCells(content, cells, context.sessionContext, sessionDialogs, translator);
|
|
1811
2064
|
}
|
|
1812
2065
|
},
|
|
1813
|
-
isEnabled: isEnabledAndSingleSelected
|
|
2066
|
+
isEnabled: isEnabledAndSingleSelected,
|
|
2067
|
+
describedBy: {
|
|
2068
|
+
args: {
|
|
2069
|
+
type: 'object',
|
|
2070
|
+
properties: {
|
|
2071
|
+
activate: {
|
|
2072
|
+
type: 'boolean',
|
|
2073
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
1814
2078
|
});
|
|
1815
2079
|
commands.addCommand(CommandIDs.restartRunAll, {
|
|
1816
2080
|
label: trans.__('Restart Kernel and Run All Cells…'),
|
|
@@ -1828,7 +2092,22 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1828
2092
|
}
|
|
1829
2093
|
},
|
|
1830
2094
|
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
1831
|
-
icon: args => (args.toolbar ? fastForwardIcon : undefined)
|
|
2095
|
+
icon: args => (args.toolbar ? fastForwardIcon : undefined),
|
|
2096
|
+
describedBy: {
|
|
2097
|
+
args: {
|
|
2098
|
+
type: 'object',
|
|
2099
|
+
properties: {
|
|
2100
|
+
toolbar: {
|
|
2101
|
+
type: 'boolean',
|
|
2102
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2103
|
+
},
|
|
2104
|
+
activate: {
|
|
2105
|
+
type: 'boolean',
|
|
2106
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
1832
2111
|
});
|
|
1833
2112
|
commands.addCommand(CommandIDs.clearAllOutputs, {
|
|
1834
2113
|
label: trans.__('Clear Outputs of All Cells'),
|
|
@@ -1839,7 +2118,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1839
2118
|
return NotebookActions.clearAllOutputs(current.content);
|
|
1840
2119
|
}
|
|
1841
2120
|
},
|
|
1842
|
-
isEnabled
|
|
2121
|
+
isEnabled,
|
|
2122
|
+
describedBy: {
|
|
2123
|
+
args: {
|
|
2124
|
+
type: 'object',
|
|
2125
|
+
properties: {}
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
1843
2128
|
});
|
|
1844
2129
|
commands.addCommand(CommandIDs.clearOutputs, {
|
|
1845
2130
|
label: trans.__('Clear Cell Output'),
|
|
@@ -1850,7 +2135,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1850
2135
|
return NotebookActions.clearOutputs(current.content);
|
|
1851
2136
|
}
|
|
1852
2137
|
},
|
|
1853
|
-
isEnabled
|
|
2138
|
+
isEnabled,
|
|
2139
|
+
describedBy: {
|
|
2140
|
+
args: {
|
|
2141
|
+
type: 'object',
|
|
2142
|
+
properties: {}
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
1854
2145
|
});
|
|
1855
2146
|
commands.addCommand(CommandIDs.interrupt, {
|
|
1856
2147
|
label: trans.__('Interrupt Kernel'),
|
|
@@ -1867,7 +2158,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1867
2158
|
}
|
|
1868
2159
|
},
|
|
1869
2160
|
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
1870
|
-
icon: args => (args.toolbar ? stopIcon : undefined)
|
|
2161
|
+
icon: args => (args.toolbar ? stopIcon : undefined),
|
|
2162
|
+
describedBy: {
|
|
2163
|
+
args: {
|
|
2164
|
+
type: 'object',
|
|
2165
|
+
properties: {
|
|
2166
|
+
toolbar: {
|
|
2167
|
+
type: 'boolean',
|
|
2168
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
1871
2173
|
});
|
|
1872
2174
|
commands.addCommand(CommandIDs.toCode, {
|
|
1873
2175
|
label: trans.__('Change to Code Cell Type'),
|
|
@@ -1877,7 +2179,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1877
2179
|
return NotebookActions.changeCellType(current.content, 'code', translator);
|
|
1878
2180
|
}
|
|
1879
2181
|
},
|
|
1880
|
-
isEnabled
|
|
2182
|
+
isEnabled,
|
|
2183
|
+
describedBy: {
|
|
2184
|
+
args: {
|
|
2185
|
+
type: 'object',
|
|
2186
|
+
properties: {}
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
1881
2189
|
});
|
|
1882
2190
|
commands.addCommand(CommandIDs.toMarkdown, {
|
|
1883
2191
|
label: trans.__('Change to Markdown Cell Type'),
|
|
@@ -1887,7 +2195,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1887
2195
|
return NotebookActions.changeCellType(current.content, 'markdown', translator);
|
|
1888
2196
|
}
|
|
1889
2197
|
},
|
|
1890
|
-
isEnabled
|
|
2198
|
+
isEnabled,
|
|
2199
|
+
describedBy: {
|
|
2200
|
+
args: {
|
|
2201
|
+
type: 'object',
|
|
2202
|
+
properties: {}
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
1891
2205
|
});
|
|
1892
2206
|
commands.addCommand(CommandIDs.toRaw, {
|
|
1893
2207
|
label: trans.__('Change to Raw Cell Type'),
|
|
@@ -1897,7 +2211,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1897
2211
|
return NotebookActions.changeCellType(current.content, 'raw', translator);
|
|
1898
2212
|
}
|
|
1899
2213
|
},
|
|
1900
|
-
isEnabled
|
|
2214
|
+
isEnabled,
|
|
2215
|
+
describedBy: {
|
|
2216
|
+
args: {
|
|
2217
|
+
type: 'object',
|
|
2218
|
+
properties: {}
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
1901
2221
|
});
|
|
1902
2222
|
commands.addCommand(CommandIDs.cut, {
|
|
1903
2223
|
label: args => {
|
|
@@ -1910,14 +2230,29 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1910
2230
|
const current = getCurrent(tracker, shell, { ...args, activate: false });
|
|
1911
2231
|
return trans._n('Cut this cell', 'Cut these %1 cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
|
|
1912
2232
|
},
|
|
1913
|
-
execute: args => {
|
|
2233
|
+
execute: async (args) => {
|
|
1914
2234
|
const current = getCurrent(tracker, shell, args);
|
|
1915
2235
|
if (current) {
|
|
1916
|
-
return NotebookActions.
|
|
2236
|
+
return await NotebookActions.cutToSystemClipboard(current.content);
|
|
1917
2237
|
}
|
|
1918
2238
|
},
|
|
1919
2239
|
icon: args => (args.toolbar ? cutIcon : undefined),
|
|
1920
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2240
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2241
|
+
describedBy: {
|
|
2242
|
+
args: {
|
|
2243
|
+
type: 'object',
|
|
2244
|
+
properties: {
|
|
2245
|
+
toolbar: {
|
|
2246
|
+
type: 'boolean',
|
|
2247
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2248
|
+
},
|
|
2249
|
+
activate: {
|
|
2250
|
+
type: 'boolean',
|
|
2251
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
1921
2256
|
});
|
|
1922
2257
|
commands.addCommand(CommandIDs.copy, {
|
|
1923
2258
|
label: args => {
|
|
@@ -1930,14 +2265,29 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1930
2265
|
const current = getCurrent(tracker, shell, { ...args, activate: false });
|
|
1931
2266
|
return trans._n('Copy this cell', 'Copy these %1 cells', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
|
|
1932
2267
|
},
|
|
1933
|
-
execute: args => {
|
|
2268
|
+
execute: async (args) => {
|
|
1934
2269
|
const current = getCurrent(tracker, shell, args);
|
|
1935
2270
|
if (current) {
|
|
1936
|
-
return NotebookActions.
|
|
2271
|
+
return await NotebookActions.copyToSystemClipboard(current.content);
|
|
1937
2272
|
}
|
|
1938
2273
|
},
|
|
1939
2274
|
icon: args => (args.toolbar ? copyIcon : undefined),
|
|
1940
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2275
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2276
|
+
describedBy: {
|
|
2277
|
+
args: {
|
|
2278
|
+
type: 'object',
|
|
2279
|
+
properties: {
|
|
2280
|
+
toolbar: {
|
|
2281
|
+
type: 'boolean',
|
|
2282
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2283
|
+
},
|
|
2284
|
+
activate: {
|
|
2285
|
+
type: 'boolean',
|
|
2286
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
1941
2291
|
});
|
|
1942
2292
|
commands.addCommand(CommandIDs.pasteBelow, {
|
|
1943
2293
|
label: args => {
|
|
@@ -1950,14 +2300,29 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1950
2300
|
const current = getCurrent(tracker, shell, { ...args, activate: false });
|
|
1951
2301
|
return trans._n('Paste this cell from the clipboard', 'Paste these %1 cells from the clipboard', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
|
|
1952
2302
|
},
|
|
1953
|
-
execute: args => {
|
|
2303
|
+
execute: async (args) => {
|
|
1954
2304
|
const current = getCurrent(tracker, shell, args);
|
|
1955
2305
|
if (current) {
|
|
1956
|
-
return NotebookActions.
|
|
2306
|
+
return await NotebookActions.pasteFromSystemClipboard(current.content, 'below');
|
|
1957
2307
|
}
|
|
1958
2308
|
},
|
|
1959
2309
|
icon: args => (args.toolbar ? pasteIcon : undefined),
|
|
1960
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2310
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2311
|
+
describedBy: {
|
|
2312
|
+
args: {
|
|
2313
|
+
type: 'object',
|
|
2314
|
+
properties: {
|
|
2315
|
+
toolbar: {
|
|
2316
|
+
type: 'boolean',
|
|
2317
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2318
|
+
},
|
|
2319
|
+
activate: {
|
|
2320
|
+
type: 'boolean',
|
|
2321
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
1961
2326
|
});
|
|
1962
2327
|
commands.addCommand(CommandIDs.pasteAbove, {
|
|
1963
2328
|
label: args => {
|
|
@@ -1970,13 +2335,24 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1970
2335
|
const current = getCurrent(tracker, shell, { ...args, activate: false });
|
|
1971
2336
|
return trans._n('Paste this cell from the clipboard', 'Paste these %1 cells from the clipboard', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
|
|
1972
2337
|
},
|
|
1973
|
-
execute: args => {
|
|
2338
|
+
execute: async (args) => {
|
|
1974
2339
|
const current = getCurrent(tracker, shell, args);
|
|
1975
2340
|
if (current) {
|
|
1976
|
-
return NotebookActions.
|
|
2341
|
+
return await NotebookActions.pasteFromSystemClipboard(current.content, 'above');
|
|
1977
2342
|
}
|
|
1978
2343
|
},
|
|
1979
|
-
isEnabled
|
|
2344
|
+
isEnabled,
|
|
2345
|
+
describedBy: {
|
|
2346
|
+
args: {
|
|
2347
|
+
type: 'object',
|
|
2348
|
+
properties: {
|
|
2349
|
+
activate: {
|
|
2350
|
+
type: 'boolean',
|
|
2351
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
1980
2356
|
});
|
|
1981
2357
|
commands.addCommand(CommandIDs.duplicateBelow, {
|
|
1982
2358
|
label: args => {
|
|
@@ -1996,7 +2372,22 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
1996
2372
|
}
|
|
1997
2373
|
},
|
|
1998
2374
|
icon: args => (args.toolbar ? duplicateIcon : undefined),
|
|
1999
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2375
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2376
|
+
describedBy: {
|
|
2377
|
+
args: {
|
|
2378
|
+
type: 'object',
|
|
2379
|
+
properties: {
|
|
2380
|
+
toolbar: {
|
|
2381
|
+
type: 'boolean',
|
|
2382
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2383
|
+
},
|
|
2384
|
+
activate: {
|
|
2385
|
+
type: 'boolean',
|
|
2386
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2000
2391
|
});
|
|
2001
2392
|
commands.addCommand(CommandIDs.pasteAndReplace, {
|
|
2002
2393
|
label: args => {
|
|
@@ -2004,13 +2395,24 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2004
2395
|
const current = getCurrent(tracker, shell, { ...args, activate: false });
|
|
2005
2396
|
return trans._n('Paste Cell and Replace', 'Paste Cells and Replace', (_a = current === null || current === void 0 ? void 0 : current.content.selectedCells.length) !== null && _a !== void 0 ? _a : 1);
|
|
2006
2397
|
},
|
|
2007
|
-
execute: args => {
|
|
2398
|
+
execute: async (args) => {
|
|
2008
2399
|
const current = getCurrent(tracker, shell, args);
|
|
2009
2400
|
if (current) {
|
|
2010
|
-
return NotebookActions.
|
|
2401
|
+
return await NotebookActions.pasteFromSystemClipboard(current.content, 'replace');
|
|
2011
2402
|
}
|
|
2012
2403
|
},
|
|
2013
|
-
isEnabled
|
|
2404
|
+
isEnabled,
|
|
2405
|
+
describedBy: {
|
|
2406
|
+
args: {
|
|
2407
|
+
type: 'object',
|
|
2408
|
+
properties: {
|
|
2409
|
+
activate: {
|
|
2410
|
+
type: 'boolean',
|
|
2411
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2014
2416
|
});
|
|
2015
2417
|
commands.addCommand(CommandIDs.deleteCell, {
|
|
2016
2418
|
label: args => {
|
|
@@ -2029,7 +2431,22 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2029
2431
|
return NotebookActions.deleteCells(current.content);
|
|
2030
2432
|
}
|
|
2031
2433
|
},
|
|
2032
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2434
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2435
|
+
describedBy: {
|
|
2436
|
+
args: {
|
|
2437
|
+
type: 'object',
|
|
2438
|
+
properties: {
|
|
2439
|
+
toolbar: {
|
|
2440
|
+
type: 'boolean',
|
|
2441
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2442
|
+
},
|
|
2443
|
+
activate: {
|
|
2444
|
+
type: 'boolean',
|
|
2445
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2033
2450
|
});
|
|
2034
2451
|
commands.addCommand(CommandIDs.split, {
|
|
2035
2452
|
label: trans.__('Split Cell'),
|
|
@@ -2039,7 +2456,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2039
2456
|
return NotebookActions.splitCell(current.content);
|
|
2040
2457
|
}
|
|
2041
2458
|
},
|
|
2042
|
-
isEnabled
|
|
2459
|
+
isEnabled,
|
|
2460
|
+
describedBy: {
|
|
2461
|
+
args: {
|
|
2462
|
+
type: 'object',
|
|
2463
|
+
properties: {}
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2043
2466
|
});
|
|
2044
2467
|
commands.addCommand(CommandIDs.merge, {
|
|
2045
2468
|
label: trans.__('Merge Selected Cells'),
|
|
@@ -2049,7 +2472,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2049
2472
|
return NotebookActions.mergeCells(current.content);
|
|
2050
2473
|
}
|
|
2051
2474
|
},
|
|
2052
|
-
isEnabled
|
|
2475
|
+
isEnabled,
|
|
2476
|
+
describedBy: {
|
|
2477
|
+
args: {
|
|
2478
|
+
type: 'object',
|
|
2479
|
+
properties: {}
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2053
2482
|
});
|
|
2054
2483
|
commands.addCommand(CommandIDs.mergeAbove, {
|
|
2055
2484
|
label: trans.__('Merge Cell Above'),
|
|
@@ -2059,7 +2488,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2059
2488
|
return NotebookActions.mergeCells(current.content, true);
|
|
2060
2489
|
}
|
|
2061
2490
|
},
|
|
2062
|
-
isEnabled
|
|
2491
|
+
isEnabled,
|
|
2492
|
+
describedBy: {
|
|
2493
|
+
args: {
|
|
2494
|
+
type: 'object',
|
|
2495
|
+
properties: {}
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2063
2498
|
});
|
|
2064
2499
|
commands.addCommand(CommandIDs.mergeBelow, {
|
|
2065
2500
|
label: trans.__('Merge Cell Below'),
|
|
@@ -2069,7 +2504,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2069
2504
|
return NotebookActions.mergeCells(current.content, false);
|
|
2070
2505
|
}
|
|
2071
2506
|
},
|
|
2072
|
-
isEnabled
|
|
2507
|
+
isEnabled,
|
|
2508
|
+
describedBy: {
|
|
2509
|
+
args: {
|
|
2510
|
+
type: 'object',
|
|
2511
|
+
properties: {}
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2073
2514
|
});
|
|
2074
2515
|
commands.addCommand(CommandIDs.insertAbove, {
|
|
2075
2516
|
label: trans.__('Insert Cell Above'),
|
|
@@ -2081,7 +2522,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2081
2522
|
}
|
|
2082
2523
|
},
|
|
2083
2524
|
icon: args => (args.toolbar ? addAboveIcon : undefined),
|
|
2084
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2525
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2526
|
+
describedBy: {
|
|
2527
|
+
args: {
|
|
2528
|
+
type: 'object',
|
|
2529
|
+
properties: {
|
|
2530
|
+
toolbar: {
|
|
2531
|
+
type: 'boolean',
|
|
2532
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2085
2537
|
});
|
|
2086
2538
|
commands.addCommand(CommandIDs.insertBelow, {
|
|
2087
2539
|
label: trans.__('Insert Cell Below'),
|
|
@@ -2093,7 +2545,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2093
2545
|
}
|
|
2094
2546
|
},
|
|
2095
2547
|
icon: args => (args.toolbar ? addBelowIcon : undefined),
|
|
2096
|
-
isEnabled: args => (args.toolbar ? true : isEnabled())
|
|
2548
|
+
isEnabled: args => (args.toolbar ? true : isEnabled()),
|
|
2549
|
+
describedBy: {
|
|
2550
|
+
args: {
|
|
2551
|
+
type: 'object',
|
|
2552
|
+
properties: {
|
|
2553
|
+
toolbar: {
|
|
2554
|
+
type: 'boolean',
|
|
2555
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2097
2560
|
});
|
|
2098
2561
|
commands.addCommand(CommandIDs.selectAbove, {
|
|
2099
2562
|
label: trans.__('Select Cell Above'),
|
|
@@ -2103,7 +2566,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2103
2566
|
return NotebookActions.selectAbove(current.content);
|
|
2104
2567
|
}
|
|
2105
2568
|
},
|
|
2106
|
-
isEnabled
|
|
2569
|
+
isEnabled,
|
|
2570
|
+
describedBy: {
|
|
2571
|
+
args: {
|
|
2572
|
+
type: 'object',
|
|
2573
|
+
properties: {}
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2107
2576
|
});
|
|
2108
2577
|
commands.addCommand(CommandIDs.selectBelow, {
|
|
2109
2578
|
label: trans.__('Select Cell Below'),
|
|
@@ -2113,7 +2582,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2113
2582
|
return NotebookActions.selectBelow(current.content);
|
|
2114
2583
|
}
|
|
2115
2584
|
},
|
|
2116
|
-
isEnabled
|
|
2585
|
+
isEnabled,
|
|
2586
|
+
describedBy: {
|
|
2587
|
+
args: {
|
|
2588
|
+
type: 'object',
|
|
2589
|
+
properties: {}
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2117
2592
|
});
|
|
2118
2593
|
commands.addCommand(CommandIDs.insertHeadingAbove, {
|
|
2119
2594
|
label: trans.__('Insert Heading Above Current Heading'),
|
|
@@ -2123,7 +2598,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2123
2598
|
return NotebookActions.insertSameLevelHeadingAbove(current.content);
|
|
2124
2599
|
}
|
|
2125
2600
|
},
|
|
2126
|
-
isEnabled
|
|
2601
|
+
isEnabled,
|
|
2602
|
+
describedBy: {
|
|
2603
|
+
args: {
|
|
2604
|
+
type: 'object',
|
|
2605
|
+
properties: {}
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2127
2608
|
});
|
|
2128
2609
|
commands.addCommand(CommandIDs.insertHeadingBelow, {
|
|
2129
2610
|
label: trans.__('Insert Heading Below Current Heading'),
|
|
@@ -2133,7 +2614,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2133
2614
|
return NotebookActions.insertSameLevelHeadingBelow(current.content);
|
|
2134
2615
|
}
|
|
2135
2616
|
},
|
|
2136
|
-
isEnabled
|
|
2617
|
+
isEnabled,
|
|
2618
|
+
describedBy: {
|
|
2619
|
+
args: {
|
|
2620
|
+
type: 'object',
|
|
2621
|
+
properties: {}
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2137
2624
|
});
|
|
2138
2625
|
commands.addCommand(CommandIDs.selectHeadingAboveOrCollapse, {
|
|
2139
2626
|
label: trans.__('Select Heading Above or Collapse Heading'),
|
|
@@ -2143,7 +2630,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2143
2630
|
return NotebookActions.selectHeadingAboveOrCollapseHeading(current.content);
|
|
2144
2631
|
}
|
|
2145
2632
|
},
|
|
2146
|
-
isEnabled
|
|
2633
|
+
isEnabled,
|
|
2634
|
+
describedBy: {
|
|
2635
|
+
args: {
|
|
2636
|
+
type: 'object',
|
|
2637
|
+
properties: {}
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2147
2640
|
});
|
|
2148
2641
|
commands.addCommand(CommandIDs.selectHeadingBelowOrExpand, {
|
|
2149
2642
|
label: trans.__('Select Heading Below or Expand Heading'),
|
|
@@ -2153,7 +2646,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2153
2646
|
return NotebookActions.selectHeadingBelowOrExpandHeading(current.content);
|
|
2154
2647
|
}
|
|
2155
2648
|
},
|
|
2156
|
-
isEnabled
|
|
2649
|
+
isEnabled,
|
|
2650
|
+
describedBy: {
|
|
2651
|
+
args: {
|
|
2652
|
+
type: 'object',
|
|
2653
|
+
properties: {}
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2157
2656
|
});
|
|
2158
2657
|
commands.addCommand(CommandIDs.extendAbove, {
|
|
2159
2658
|
label: trans.__('Extend Selection Above'),
|
|
@@ -2163,7 +2662,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2163
2662
|
return NotebookActions.extendSelectionAbove(current.content);
|
|
2164
2663
|
}
|
|
2165
2664
|
},
|
|
2166
|
-
isEnabled
|
|
2665
|
+
isEnabled,
|
|
2666
|
+
describedBy: {
|
|
2667
|
+
args: {
|
|
2668
|
+
type: 'object',
|
|
2669
|
+
properties: {}
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2167
2672
|
});
|
|
2168
2673
|
commands.addCommand(CommandIDs.extendTop, {
|
|
2169
2674
|
label: trans.__('Extend Selection to Top'),
|
|
@@ -2173,7 +2678,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2173
2678
|
return NotebookActions.extendSelectionAbove(current.content, true);
|
|
2174
2679
|
}
|
|
2175
2680
|
},
|
|
2176
|
-
isEnabled
|
|
2681
|
+
isEnabled,
|
|
2682
|
+
describedBy: {
|
|
2683
|
+
args: {
|
|
2684
|
+
type: 'object',
|
|
2685
|
+
properties: {}
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2177
2688
|
});
|
|
2178
2689
|
commands.addCommand(CommandIDs.extendBelow, {
|
|
2179
2690
|
label: trans.__('Extend Selection Below'),
|
|
@@ -2183,7 +2694,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2183
2694
|
return NotebookActions.extendSelectionBelow(current.content);
|
|
2184
2695
|
}
|
|
2185
2696
|
},
|
|
2186
|
-
isEnabled
|
|
2697
|
+
isEnabled,
|
|
2698
|
+
describedBy: {
|
|
2699
|
+
args: {
|
|
2700
|
+
type: 'object',
|
|
2701
|
+
properties: {}
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2187
2704
|
});
|
|
2188
2705
|
commands.addCommand(CommandIDs.extendBottom, {
|
|
2189
2706
|
label: trans.__('Extend Selection to Bottom'),
|
|
@@ -2193,7 +2710,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2193
2710
|
return NotebookActions.extendSelectionBelow(current.content, true);
|
|
2194
2711
|
}
|
|
2195
2712
|
},
|
|
2196
|
-
isEnabled
|
|
2713
|
+
isEnabled,
|
|
2714
|
+
describedBy: {
|
|
2715
|
+
args: {
|
|
2716
|
+
type: 'object',
|
|
2717
|
+
properties: {}
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2197
2720
|
});
|
|
2198
2721
|
commands.addCommand(CommandIDs.selectAll, {
|
|
2199
2722
|
label: trans.__('Select All Cells'),
|
|
@@ -2203,7 +2726,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2203
2726
|
return NotebookActions.selectAll(current.content);
|
|
2204
2727
|
}
|
|
2205
2728
|
},
|
|
2206
|
-
isEnabled
|
|
2729
|
+
isEnabled,
|
|
2730
|
+
describedBy: {
|
|
2731
|
+
args: {
|
|
2732
|
+
type: 'object',
|
|
2733
|
+
properties: {}
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2207
2736
|
});
|
|
2208
2737
|
commands.addCommand(CommandIDs.deselectAll, {
|
|
2209
2738
|
label: trans.__('Deselect All Cells'),
|
|
@@ -2213,7 +2742,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2213
2742
|
return NotebookActions.deselectAll(current.content);
|
|
2214
2743
|
}
|
|
2215
2744
|
},
|
|
2216
|
-
isEnabled
|
|
2745
|
+
isEnabled,
|
|
2746
|
+
describedBy: {
|
|
2747
|
+
args: {
|
|
2748
|
+
type: 'object',
|
|
2749
|
+
properties: {}
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2217
2752
|
});
|
|
2218
2753
|
commands.addCommand(CommandIDs.moveUp, {
|
|
2219
2754
|
label: args => {
|
|
@@ -2240,7 +2775,22 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2240
2775
|
}
|
|
2241
2776
|
return current.content.activeCellIndex >= 1;
|
|
2242
2777
|
},
|
|
2243
|
-
icon: args => (args.toolbar ? moveUpIcon : undefined)
|
|
2778
|
+
icon: args => (args.toolbar ? moveUpIcon : undefined),
|
|
2779
|
+
describedBy: {
|
|
2780
|
+
args: {
|
|
2781
|
+
type: 'object',
|
|
2782
|
+
properties: {
|
|
2783
|
+
toolbar: {
|
|
2784
|
+
type: 'boolean',
|
|
2785
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2786
|
+
},
|
|
2787
|
+
activate: {
|
|
2788
|
+
type: 'boolean',
|
|
2789
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2244
2794
|
});
|
|
2245
2795
|
commands.addCommand(CommandIDs.moveDown, {
|
|
2246
2796
|
label: args => {
|
|
@@ -2268,7 +2818,22 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2268
2818
|
const length = current.content.model.cells.length;
|
|
2269
2819
|
return current.content.activeCellIndex < length - 1;
|
|
2270
2820
|
},
|
|
2271
|
-
icon: args => (args.toolbar ? moveDownIcon : undefined)
|
|
2821
|
+
icon: args => (args.toolbar ? moveDownIcon : undefined),
|
|
2822
|
+
describedBy: {
|
|
2823
|
+
args: {
|
|
2824
|
+
type: 'object',
|
|
2825
|
+
properties: {
|
|
2826
|
+
toolbar: {
|
|
2827
|
+
type: 'boolean',
|
|
2828
|
+
description: 'Whether the command is being executed from the toolbar'
|
|
2829
|
+
},
|
|
2830
|
+
activate: {
|
|
2831
|
+
type: 'boolean',
|
|
2832
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2272
2837
|
});
|
|
2273
2838
|
commands.addCommand(CommandIDs.toggleAllLines, {
|
|
2274
2839
|
label: trans.__('Show Line Numbers'),
|
|
@@ -2290,6 +2855,17 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2290
2855
|
else {
|
|
2291
2856
|
return false;
|
|
2292
2857
|
}
|
|
2858
|
+
},
|
|
2859
|
+
describedBy: {
|
|
2860
|
+
args: {
|
|
2861
|
+
type: 'object',
|
|
2862
|
+
properties: {
|
|
2863
|
+
activate: {
|
|
2864
|
+
type: 'boolean',
|
|
2865
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2293
2869
|
}
|
|
2294
2870
|
});
|
|
2295
2871
|
commands.addCommand(CommandIDs.commandMode, {
|
|
@@ -2300,7 +2876,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2300
2876
|
current.content.mode = 'command';
|
|
2301
2877
|
}
|
|
2302
2878
|
},
|
|
2303
|
-
isEnabled
|
|
2879
|
+
isEnabled,
|
|
2880
|
+
describedBy: {
|
|
2881
|
+
args: {
|
|
2882
|
+
type: 'object',
|
|
2883
|
+
properties: {}
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2304
2886
|
});
|
|
2305
2887
|
commands.addCommand(CommandIDs.editMode, {
|
|
2306
2888
|
label: trans.__('Enter Edit Mode'),
|
|
@@ -2310,7 +2892,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2310
2892
|
current.content.mode = 'edit';
|
|
2311
2893
|
}
|
|
2312
2894
|
},
|
|
2313
|
-
isEnabled
|
|
2895
|
+
isEnabled,
|
|
2896
|
+
describedBy: {
|
|
2897
|
+
args: {
|
|
2898
|
+
type: 'object',
|
|
2899
|
+
properties: {}
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2314
2902
|
});
|
|
2315
2903
|
commands.addCommand(CommandIDs.undoCellAction, {
|
|
2316
2904
|
label: trans.__('Undo Cell Operation'),
|
|
@@ -2320,7 +2908,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2320
2908
|
return NotebookActions.undo(current.content);
|
|
2321
2909
|
}
|
|
2322
2910
|
},
|
|
2323
|
-
isEnabled
|
|
2911
|
+
isEnabled,
|
|
2912
|
+
describedBy: {
|
|
2913
|
+
args: {
|
|
2914
|
+
type: 'object',
|
|
2915
|
+
properties: {}
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2324
2918
|
});
|
|
2325
2919
|
commands.addCommand(CommandIDs.redoCellAction, {
|
|
2326
2920
|
label: trans.__('Redo Cell Operation'),
|
|
@@ -2330,7 +2924,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2330
2924
|
return NotebookActions.redo(current.content);
|
|
2331
2925
|
}
|
|
2332
2926
|
},
|
|
2333
|
-
isEnabled
|
|
2927
|
+
isEnabled,
|
|
2928
|
+
describedBy: {
|
|
2929
|
+
args: {
|
|
2930
|
+
type: 'object',
|
|
2931
|
+
properties: {}
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2334
2934
|
});
|
|
2335
2935
|
commands.addCommand(CommandIDs.redo, {
|
|
2336
2936
|
label: trans.__('Redo'),
|
|
@@ -2344,6 +2944,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2344
2944
|
return (_a = cell.editor) === null || _a === void 0 ? void 0 : _a.redo();
|
|
2345
2945
|
}
|
|
2346
2946
|
}
|
|
2947
|
+
},
|
|
2948
|
+
describedBy: {
|
|
2949
|
+
args: {
|
|
2950
|
+
type: 'object',
|
|
2951
|
+
properties: {}
|
|
2952
|
+
}
|
|
2347
2953
|
}
|
|
2348
2954
|
});
|
|
2349
2955
|
commands.addCommand(CommandIDs.undo, {
|
|
@@ -2358,6 +2964,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2358
2964
|
return (_a = cell.editor) === null || _a === void 0 ? void 0 : _a.undo();
|
|
2359
2965
|
}
|
|
2360
2966
|
}
|
|
2967
|
+
},
|
|
2968
|
+
describedBy: {
|
|
2969
|
+
args: {
|
|
2970
|
+
type: 'object',
|
|
2971
|
+
properties: {}
|
|
2972
|
+
}
|
|
2361
2973
|
}
|
|
2362
2974
|
});
|
|
2363
2975
|
commands.addCommand(CommandIDs.changeKernel, {
|
|
@@ -2368,7 +2980,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2368
2980
|
return sessionDialogs.selectKernel(current.context.sessionContext);
|
|
2369
2981
|
}
|
|
2370
2982
|
},
|
|
2371
|
-
isEnabled
|
|
2983
|
+
isEnabled,
|
|
2984
|
+
describedBy: {
|
|
2985
|
+
args: {
|
|
2986
|
+
type: 'object',
|
|
2987
|
+
properties: {}
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2372
2990
|
});
|
|
2373
2991
|
commands.addCommand(CommandIDs.getKernel, {
|
|
2374
2992
|
label: trans.__('Get Kernel'),
|
|
@@ -2379,7 +2997,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2379
2997
|
return (_a = current.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
|
|
2380
2998
|
}
|
|
2381
2999
|
},
|
|
2382
|
-
isEnabled
|
|
3000
|
+
isEnabled,
|
|
3001
|
+
describedBy: {
|
|
3002
|
+
args: {
|
|
3003
|
+
type: 'object',
|
|
3004
|
+
properties: {
|
|
3005
|
+
activate: {
|
|
3006
|
+
type: 'boolean',
|
|
3007
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
2383
3012
|
});
|
|
2384
3013
|
commands.addCommand(CommandIDs.reconnectToKernel, {
|
|
2385
3014
|
label: trans.__('Reconnect to Kernel'),
|
|
@@ -2394,7 +3023,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2394
3023
|
return kernel.reconnect();
|
|
2395
3024
|
}
|
|
2396
3025
|
},
|
|
2397
|
-
isEnabled
|
|
3026
|
+
isEnabled,
|
|
3027
|
+
describedBy: {
|
|
3028
|
+
args: {
|
|
3029
|
+
type: 'object',
|
|
3030
|
+
properties: {}
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
2398
3033
|
});
|
|
2399
3034
|
commands.addCommand(CommandIDs.markdown1, {
|
|
2400
3035
|
label: trans.__('Change to Heading 1'),
|
|
@@ -2404,7 +3039,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2404
3039
|
return NotebookActions.setMarkdownHeader(current.content, 1, translator);
|
|
2405
3040
|
}
|
|
2406
3041
|
},
|
|
2407
|
-
isEnabled
|
|
3042
|
+
isEnabled,
|
|
3043
|
+
describedBy: {
|
|
3044
|
+
args: {
|
|
3045
|
+
type: 'object',
|
|
3046
|
+
properties: {}
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
2408
3049
|
});
|
|
2409
3050
|
commands.addCommand(CommandIDs.markdown2, {
|
|
2410
3051
|
label: trans.__('Change to Heading 2'),
|
|
@@ -2414,7 +3055,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2414
3055
|
return NotebookActions.setMarkdownHeader(current.content, 2, translator);
|
|
2415
3056
|
}
|
|
2416
3057
|
},
|
|
2417
|
-
isEnabled
|
|
3058
|
+
isEnabled,
|
|
3059
|
+
describedBy: {
|
|
3060
|
+
args: {
|
|
3061
|
+
type: 'object',
|
|
3062
|
+
properties: {}
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
2418
3065
|
});
|
|
2419
3066
|
commands.addCommand(CommandIDs.markdown3, {
|
|
2420
3067
|
label: trans.__('Change to Heading 3'),
|
|
@@ -2424,7 +3071,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2424
3071
|
return NotebookActions.setMarkdownHeader(current.content, 3, translator);
|
|
2425
3072
|
}
|
|
2426
3073
|
},
|
|
2427
|
-
isEnabled
|
|
3074
|
+
isEnabled,
|
|
3075
|
+
describedBy: {
|
|
3076
|
+
args: {
|
|
3077
|
+
type: 'object',
|
|
3078
|
+
properties: {}
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
2428
3081
|
});
|
|
2429
3082
|
commands.addCommand(CommandIDs.markdown4, {
|
|
2430
3083
|
label: trans.__('Change to Heading 4'),
|
|
@@ -2434,7 +3087,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2434
3087
|
return NotebookActions.setMarkdownHeader(current.content, 4, translator);
|
|
2435
3088
|
}
|
|
2436
3089
|
},
|
|
2437
|
-
isEnabled
|
|
3090
|
+
isEnabled,
|
|
3091
|
+
describedBy: {
|
|
3092
|
+
args: {
|
|
3093
|
+
type: 'object',
|
|
3094
|
+
properties: {}
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
2438
3097
|
});
|
|
2439
3098
|
commands.addCommand(CommandIDs.markdown5, {
|
|
2440
3099
|
label: trans.__('Change to Heading 5'),
|
|
@@ -2444,7 +3103,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2444
3103
|
return NotebookActions.setMarkdownHeader(current.content, 5, translator);
|
|
2445
3104
|
}
|
|
2446
3105
|
},
|
|
2447
|
-
isEnabled
|
|
3106
|
+
isEnabled,
|
|
3107
|
+
describedBy: {
|
|
3108
|
+
args: {
|
|
3109
|
+
type: 'object',
|
|
3110
|
+
properties: {}
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
2448
3113
|
});
|
|
2449
3114
|
commands.addCommand(CommandIDs.markdown6, {
|
|
2450
3115
|
label: trans.__('Change to Heading 6'),
|
|
@@ -2454,7 +3119,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2454
3119
|
return NotebookActions.setMarkdownHeader(current.content, 6, translator);
|
|
2455
3120
|
}
|
|
2456
3121
|
},
|
|
2457
|
-
isEnabled
|
|
3122
|
+
isEnabled,
|
|
3123
|
+
describedBy: {
|
|
3124
|
+
args: {
|
|
3125
|
+
type: 'object',
|
|
3126
|
+
properties: {}
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
2458
3129
|
});
|
|
2459
3130
|
commands.addCommand(CommandIDs.hideCode, {
|
|
2460
3131
|
label: trans.__('Collapse Selected Code'),
|
|
@@ -2464,7 +3135,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2464
3135
|
return NotebookActions.hideCode(current.content);
|
|
2465
3136
|
}
|
|
2466
3137
|
},
|
|
2467
|
-
isEnabled
|
|
3138
|
+
isEnabled,
|
|
3139
|
+
describedBy: {
|
|
3140
|
+
args: {
|
|
3141
|
+
type: 'object',
|
|
3142
|
+
properties: {}
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
2468
3145
|
});
|
|
2469
3146
|
commands.addCommand(CommandIDs.showCode, {
|
|
2470
3147
|
label: trans.__('Expand Selected Code'),
|
|
@@ -2474,7 +3151,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2474
3151
|
return NotebookActions.showCode(current.content);
|
|
2475
3152
|
}
|
|
2476
3153
|
},
|
|
2477
|
-
isEnabled
|
|
3154
|
+
isEnabled,
|
|
3155
|
+
describedBy: {
|
|
3156
|
+
args: {
|
|
3157
|
+
type: 'object',
|
|
3158
|
+
properties: {}
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
2478
3161
|
});
|
|
2479
3162
|
commands.addCommand(CommandIDs.hideAllCode, {
|
|
2480
3163
|
label: trans.__('Collapse All Code'),
|
|
@@ -2484,7 +3167,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2484
3167
|
return NotebookActions.hideAllCode(current.content);
|
|
2485
3168
|
}
|
|
2486
3169
|
},
|
|
2487
|
-
isEnabled
|
|
3170
|
+
isEnabled,
|
|
3171
|
+
describedBy: {
|
|
3172
|
+
args: {
|
|
3173
|
+
type: 'object',
|
|
3174
|
+
properties: {}
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
2488
3177
|
});
|
|
2489
3178
|
commands.addCommand(CommandIDs.showAllCode, {
|
|
2490
3179
|
label: trans.__('Expand All Code'),
|
|
@@ -2494,7 +3183,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2494
3183
|
return NotebookActions.showAllCode(current.content);
|
|
2495
3184
|
}
|
|
2496
3185
|
},
|
|
2497
|
-
isEnabled
|
|
3186
|
+
isEnabled,
|
|
3187
|
+
describedBy: {
|
|
3188
|
+
args: {
|
|
3189
|
+
type: 'object',
|
|
3190
|
+
properties: {}
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
2498
3193
|
});
|
|
2499
3194
|
commands.addCommand(CommandIDs.hideOutput, {
|
|
2500
3195
|
label: trans.__('Collapse Selected Outputs'),
|
|
@@ -2504,7 +3199,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2504
3199
|
return NotebookActions.hideOutput(current.content);
|
|
2505
3200
|
}
|
|
2506
3201
|
},
|
|
2507
|
-
isEnabled
|
|
3202
|
+
isEnabled,
|
|
3203
|
+
describedBy: {
|
|
3204
|
+
args: {
|
|
3205
|
+
type: 'object',
|
|
3206
|
+
properties: {}
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
2508
3209
|
});
|
|
2509
3210
|
commands.addCommand(CommandIDs.showOutput, {
|
|
2510
3211
|
label: trans.__('Expand Selected Outputs'),
|
|
@@ -2514,7 +3215,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2514
3215
|
return NotebookActions.showOutput(current.content);
|
|
2515
3216
|
}
|
|
2516
3217
|
},
|
|
2517
|
-
isEnabled
|
|
3218
|
+
isEnabled,
|
|
3219
|
+
describedBy: {
|
|
3220
|
+
args: {
|
|
3221
|
+
type: 'object',
|
|
3222
|
+
properties: {}
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
2518
3225
|
});
|
|
2519
3226
|
commands.addCommand(CommandIDs.toggleOutput, {
|
|
2520
3227
|
label: trans.__('Toggle Visibility of Selected Outputs'),
|
|
@@ -2524,7 +3231,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2524
3231
|
return NotebookActions.toggleOutput(current.content);
|
|
2525
3232
|
}
|
|
2526
3233
|
},
|
|
2527
|
-
isEnabled
|
|
3234
|
+
isEnabled,
|
|
3235
|
+
describedBy: {
|
|
3236
|
+
args: {
|
|
3237
|
+
type: 'object',
|
|
3238
|
+
properties: {}
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
2528
3241
|
});
|
|
2529
3242
|
commands.addCommand(CommandIDs.hideAllOutputs, {
|
|
2530
3243
|
label: trans.__('Collapse All Outputs'),
|
|
@@ -2534,7 +3247,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2534
3247
|
return NotebookActions.hideAllOutputs(current.content);
|
|
2535
3248
|
}
|
|
2536
3249
|
},
|
|
2537
|
-
isEnabled
|
|
3250
|
+
isEnabled,
|
|
3251
|
+
describedBy: {
|
|
3252
|
+
args: {
|
|
3253
|
+
type: 'object',
|
|
3254
|
+
properties: {}
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
2538
3257
|
});
|
|
2539
3258
|
commands.addCommand(CommandIDs.toggleRenderSideBySideCurrentNotebook, {
|
|
2540
3259
|
label: trans.__('Render Side-by-Side'),
|
|
@@ -2556,6 +3275,17 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2556
3275
|
else {
|
|
2557
3276
|
return false;
|
|
2558
3277
|
}
|
|
3278
|
+
},
|
|
3279
|
+
describedBy: {
|
|
3280
|
+
args: {
|
|
3281
|
+
type: 'object',
|
|
3282
|
+
properties: {
|
|
3283
|
+
activate: {
|
|
3284
|
+
type: 'boolean',
|
|
3285
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
2559
3289
|
}
|
|
2560
3290
|
});
|
|
2561
3291
|
commands.addCommand(CommandIDs.showAllOutputs, {
|
|
@@ -2566,7 +3296,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2566
3296
|
return NotebookActions.showAllOutputs(current.content);
|
|
2567
3297
|
}
|
|
2568
3298
|
},
|
|
2569
|
-
isEnabled
|
|
3299
|
+
isEnabled,
|
|
3300
|
+
describedBy: {
|
|
3301
|
+
args: {
|
|
3302
|
+
type: 'object',
|
|
3303
|
+
properties: {}
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
2570
3306
|
});
|
|
2571
3307
|
commands.addCommand(CommandIDs.enableOutputScrolling, {
|
|
2572
3308
|
label: trans.__('Enable Scrolling for Outputs'),
|
|
@@ -2576,7 +3312,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2576
3312
|
return NotebookActions.enableOutputScrolling(current.content);
|
|
2577
3313
|
}
|
|
2578
3314
|
},
|
|
2579
|
-
isEnabled
|
|
3315
|
+
isEnabled,
|
|
3316
|
+
describedBy: {
|
|
3317
|
+
args: {
|
|
3318
|
+
type: 'object',
|
|
3319
|
+
properties: {}
|
|
3320
|
+
}
|
|
3321
|
+
}
|
|
2580
3322
|
});
|
|
2581
3323
|
commands.addCommand(CommandIDs.disableOutputScrolling, {
|
|
2582
3324
|
label: trans.__('Disable Scrolling for Outputs'),
|
|
@@ -2586,7 +3328,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2586
3328
|
return NotebookActions.disableOutputScrolling(current.content);
|
|
2587
3329
|
}
|
|
2588
3330
|
},
|
|
2589
|
-
isEnabled
|
|
3331
|
+
isEnabled,
|
|
3332
|
+
describedBy: {
|
|
3333
|
+
args: {
|
|
3334
|
+
type: 'object',
|
|
3335
|
+
properties: {}
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
2590
3338
|
});
|
|
2591
3339
|
commands.addCommand(CommandIDs.selectLastRunCell, {
|
|
2592
3340
|
label: trans.__('Select current running or last run cell'),
|
|
@@ -2596,7 +3344,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2596
3344
|
return NotebookActions.selectLastRunCell(current.content);
|
|
2597
3345
|
}
|
|
2598
3346
|
},
|
|
2599
|
-
isEnabled
|
|
3347
|
+
isEnabled,
|
|
3348
|
+
describedBy: {
|
|
3349
|
+
args: {
|
|
3350
|
+
type: 'object',
|
|
3351
|
+
properties: {}
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
2600
3354
|
});
|
|
2601
3355
|
commands.addCommand(CommandIDs.replaceSelection, {
|
|
2602
3356
|
label: trans.__('Replace Selection in Notebook Cell'),
|
|
@@ -2607,7 +3361,18 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2607
3361
|
return NotebookActions.replaceSelection(current.content, text);
|
|
2608
3362
|
}
|
|
2609
3363
|
},
|
|
2610
|
-
isEnabled
|
|
3364
|
+
isEnabled,
|
|
3365
|
+
describedBy: {
|
|
3366
|
+
args: {
|
|
3367
|
+
type: 'object',
|
|
3368
|
+
properties: {
|
|
3369
|
+
text: {
|
|
3370
|
+
type: 'string',
|
|
3371
|
+
description: trans.__('Text to replace the selection with')
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
2611
3376
|
});
|
|
2612
3377
|
commands.addCommand(CommandIDs.toggleCollapseCmd, {
|
|
2613
3378
|
label: trans.__('Toggle Collapse Notebook Heading'),
|
|
@@ -2617,7 +3382,13 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2617
3382
|
return NotebookActions.toggleCurrentHeadingCollapse(current.content);
|
|
2618
3383
|
}
|
|
2619
3384
|
},
|
|
2620
|
-
isEnabled: isEnabledAndHeadingSelected
|
|
3385
|
+
isEnabled: isEnabledAndHeadingSelected,
|
|
3386
|
+
describedBy: {
|
|
3387
|
+
args: {
|
|
3388
|
+
type: 'object',
|
|
3389
|
+
properties: {}
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
2621
3392
|
});
|
|
2622
3393
|
commands.addCommand(CommandIDs.collapseAllCmd, {
|
|
2623
3394
|
label: trans.__('Collapse All Headings'),
|
|
@@ -2626,6 +3397,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2626
3397
|
if (current) {
|
|
2627
3398
|
return NotebookActions.collapseAllHeadings(current.content);
|
|
2628
3399
|
}
|
|
3400
|
+
},
|
|
3401
|
+
describedBy: {
|
|
3402
|
+
args: {
|
|
3403
|
+
type: 'object',
|
|
3404
|
+
properties: {}
|
|
3405
|
+
}
|
|
2629
3406
|
}
|
|
2630
3407
|
});
|
|
2631
3408
|
commands.addCommand(CommandIDs.expandAllCmd, {
|
|
@@ -2635,6 +3412,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2635
3412
|
if (current) {
|
|
2636
3413
|
return NotebookActions.expandAllHeadings(current.content);
|
|
2637
3414
|
}
|
|
3415
|
+
},
|
|
3416
|
+
describedBy: {
|
|
3417
|
+
args: {
|
|
3418
|
+
type: 'object',
|
|
3419
|
+
properties: {}
|
|
3420
|
+
}
|
|
2638
3421
|
}
|
|
2639
3422
|
});
|
|
2640
3423
|
commands.addCommand(CommandIDs.tocRunCells, {
|
|
@@ -2662,6 +3445,17 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2662
3445
|
}
|
|
2663
3446
|
current.content.extendContiguousSelectionTo(lastIndex);
|
|
2664
3447
|
void NotebookActions.run(current.content, current.sessionContext, sessionDialogs, translator);
|
|
3448
|
+
},
|
|
3449
|
+
describedBy: {
|
|
3450
|
+
args: {
|
|
3451
|
+
type: 'object',
|
|
3452
|
+
properties: {
|
|
3453
|
+
activate: {
|
|
3454
|
+
type: 'boolean',
|
|
3455
|
+
description: trans.__('Whether to activate the notebook after execution')
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
2665
3459
|
}
|
|
2666
3460
|
});
|
|
2667
3461
|
commands.addCommand(CommandIDs.accessPreviousHistory, {
|
|
@@ -2671,6 +3465,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2671
3465
|
if (current) {
|
|
2672
3466
|
return await NotebookActions.accessPreviousHistory(current.content);
|
|
2673
3467
|
}
|
|
3468
|
+
},
|
|
3469
|
+
describedBy: {
|
|
3470
|
+
args: {
|
|
3471
|
+
type: 'object',
|
|
3472
|
+
properties: {}
|
|
3473
|
+
}
|
|
2674
3474
|
}
|
|
2675
3475
|
});
|
|
2676
3476
|
commands.addCommand(CommandIDs.accessNextHistory, {
|
|
@@ -2680,6 +3480,12 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2680
3480
|
if (current) {
|
|
2681
3481
|
return await NotebookActions.accessNextHistory(current.content);
|
|
2682
3482
|
}
|
|
3483
|
+
},
|
|
3484
|
+
describedBy: {
|
|
3485
|
+
args: {
|
|
3486
|
+
type: 'object',
|
|
3487
|
+
properties: {}
|
|
3488
|
+
}
|
|
2683
3489
|
}
|
|
2684
3490
|
});
|
|
2685
3491
|
commands.addCommand(CommandIDs.virtualScrollbar, {
|
|
@@ -2708,6 +3514,17 @@ function addCommands(app, tracker, translator, sessionDialogs, settings, isEnabl
|
|
|
2708
3514
|
const visible = (args.toolbar ? true : isEnabled()) &&
|
|
2709
3515
|
((_a = (settings === null || settings === void 0 ? void 0 : settings.composite.windowingMode) === 'full') !== null && _a !== void 0 ? _a : false);
|
|
2710
3516
|
return visible;
|
|
3517
|
+
},
|
|
3518
|
+
describedBy: {
|
|
3519
|
+
args: {
|
|
3520
|
+
type: 'object',
|
|
3521
|
+
properties: {
|
|
3522
|
+
toolbar: {
|
|
3523
|
+
type: 'boolean',
|
|
3524
|
+
description: trans.__('Whether the command is called from toolbar')
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
}
|
|
2711
3528
|
}
|
|
2712
3529
|
});
|
|
2713
3530
|
// All commands with isEnabled defined directly or in a semantic commands
|