@difizen/libro-jupyter 0.3.9 → 0.3.11
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/command-contribution.d.ts.map +1 -1
- package/es/command/command-contribution.js +4 -14
- package/es/toolbar/side-toolbar-run-selector.d.ts.map +1 -1
- package/es/toolbar/side-toolbar-run-selector.js +14 -2
- package/package.json +17 -17
- package/src/command/command-contribution.ts +2 -12
- package/src/toolbar/side-toolbar-run-selector.tsx +23 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAMb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAMb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CAoIjD"}
|
|
@@ -11,7 +11,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
11
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
12
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
13
13
|
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.'); }
|
|
14
|
-
import { KernelCommands, LibroCommandRegister, LibroService, LibroToolbarArea, LibroView, NotebookCommands, ExecutableCellView
|
|
14
|
+
import { KernelCommands, LibroCommandRegister, LibroService, LibroToolbarArea, LibroView, NotebookCommands, ExecutableCellView } from '@difizen/libro-core';
|
|
15
15
|
import { CommandContribution, inject, ModalService, singleton } from '@difizen/mana-app';
|
|
16
16
|
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
17
17
|
import { ExecutedWithKernelCellModel } from "../libro-jupyter-protocol.js";
|
|
@@ -81,26 +81,16 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
81
81
|
});
|
|
82
82
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['SideToolbarRunSelect'], {
|
|
83
83
|
execute: function () {
|
|
84
|
-
var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(
|
|
84
|
+
var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
85
85
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
86
86
|
while (1) switch (_context2.prev = _context2.next) {
|
|
87
87
|
case 0:
|
|
88
|
-
if (!(!cell || !libro || !(cell instanceof LibroCellView) || !(libro instanceof LibroView))) {
|
|
89
|
-
_context2.next = 2;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
return _context2.abrupt("return");
|
|
93
|
-
case 2:
|
|
94
|
-
if (libro.model.executable) {
|
|
95
|
-
libro.runCell(cell);
|
|
96
|
-
}
|
|
97
|
-
case 3:
|
|
98
88
|
case "end":
|
|
99
89
|
return _context2.stop();
|
|
100
90
|
}
|
|
101
91
|
}, _callee2);
|
|
102
92
|
}));
|
|
103
|
-
function execute(
|
|
93
|
+
function execute() {
|
|
104
94
|
return _execute2.apply(this, arguments);
|
|
105
95
|
}
|
|
106
96
|
return execute;
|
|
@@ -139,7 +129,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
139
129
|
}
|
|
140
130
|
}, _callee3);
|
|
141
131
|
}));
|
|
142
|
-
function execute(
|
|
132
|
+
function execute(_x3, _x4) {
|
|
143
133
|
return _execute3.apply(this, arguments);
|
|
144
134
|
}
|
|
145
135
|
return execute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-toolbar-run-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolbar-run-selector.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"side-toolbar-run-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolbar-run-selector.tsx"],"names":[],"mappings":";AAyBA,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EA2F1C,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
7
|
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); }
|
|
@@ -7,7 +11,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
11
|
import { PlayCircleOutlined } from '@ant-design/icons';
|
|
8
12
|
import { NotebookCommands, LibroSideToolbarMenu } from '@difizen/libro-core';
|
|
9
13
|
import { ServerManager } from '@difizen/libro-kernel';
|
|
10
|
-
import { ConfigurationService, useInject, ViewInstance } from '@difizen/mana-app';
|
|
14
|
+
import { ConfigurationService, useInject, ViewInstance, CommandRegistry, ToolbarInstance, getOrigin } from '@difizen/mana-app';
|
|
11
15
|
import { l10n } from '@difizen/mana-l10n';
|
|
12
16
|
import { Popover, Tooltip } from 'antd';
|
|
13
17
|
import { useEffect, useState } from 'react';
|
|
@@ -21,6 +25,10 @@ export var SideToolbarRunSelector = function SideToolbarRunSelector() {
|
|
|
21
25
|
var libroServerManager = useInject(ServerManager);
|
|
22
26
|
var configService = useInject(ConfigurationService);
|
|
23
27
|
var libroModel = libroView ? libroView.model : undefined;
|
|
28
|
+
var command = useInject(CommandRegistry);
|
|
29
|
+
var toolbar = useInject(ToolbarInstance);
|
|
30
|
+
var data = toolbar.currentArgs;
|
|
31
|
+
var args = getOrigin(data) || [];
|
|
24
32
|
var items = [{
|
|
25
33
|
id: NotebookCommands['RunCell'].id,
|
|
26
34
|
label: /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -79,7 +87,11 @@ export var SideToolbarRunSelector = function SideToolbarRunSelector() {
|
|
|
79
87
|
}),
|
|
80
88
|
trigger: "hover",
|
|
81
89
|
overlayClassName: "libro-popover-side-toolbar-menu libro-side-toolbar-run-select-menu",
|
|
82
|
-
children: /*#__PURE__*/_jsx(PlayCircleOutlined, {
|
|
90
|
+
children: /*#__PURE__*/_jsx(PlayCircleOutlined, {
|
|
91
|
+
onClick: function onClick() {
|
|
92
|
+
command.executeCommand.apply(command, [NotebookCommands['RunCell'].id].concat(_toConsumableArray(args)));
|
|
93
|
+
}
|
|
94
|
+
})
|
|
83
95
|
});
|
|
84
96
|
}
|
|
85
97
|
return /*#__PURE__*/_jsx(Tooltip, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro"
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ant-design/colors": "^7.0.0",
|
|
39
39
|
"@ant-design/icons": "^5.1.0",
|
|
40
|
-
"@difizen/libro-code-cell": "^0.3.
|
|
41
|
-
"@difizen/libro-code-editor": "^0.3.
|
|
42
|
-
"@difizen/libro-codemirror": "^0.3.
|
|
43
|
-
"@difizen/libro-cofine-editor": "^0.3.
|
|
44
|
-
"@difizen/libro-common": "^0.3.
|
|
45
|
-
"@difizen/libro-core": "^0.3.
|
|
46
|
-
"@difizen/libro-kernel": "^0.3.
|
|
47
|
-
"@difizen/libro-l10n": "^0.3.
|
|
48
|
-
"@difizen/libro-language-client": "^0.3.
|
|
49
|
-
"@difizen/libro-lsp": "^0.3.
|
|
50
|
-
"@difizen/libro-markdown-cell": "^0.3.
|
|
51
|
-
"@difizen/libro-output": "^0.3.
|
|
52
|
-
"@difizen/libro-raw-cell": "^0.3.
|
|
53
|
-
"@difizen/libro-rendermime": "^0.3.
|
|
54
|
-
"@difizen/libro-search": "^0.3.
|
|
55
|
-
"@difizen/libro-search-code-cell": "^0.3.
|
|
40
|
+
"@difizen/libro-code-cell": "^0.3.11",
|
|
41
|
+
"@difizen/libro-code-editor": "^0.3.11",
|
|
42
|
+
"@difizen/libro-codemirror": "^0.3.11",
|
|
43
|
+
"@difizen/libro-cofine-editor": "^0.3.11",
|
|
44
|
+
"@difizen/libro-common": "^0.3.11",
|
|
45
|
+
"@difizen/libro-core": "^0.3.11",
|
|
46
|
+
"@difizen/libro-kernel": "^0.3.11",
|
|
47
|
+
"@difizen/libro-l10n": "^0.3.11",
|
|
48
|
+
"@difizen/libro-language-client": "^0.3.11",
|
|
49
|
+
"@difizen/libro-lsp": "^0.3.11",
|
|
50
|
+
"@difizen/libro-markdown-cell": "^0.3.11",
|
|
51
|
+
"@difizen/libro-output": "^0.3.11",
|
|
52
|
+
"@difizen/libro-raw-cell": "^0.3.11",
|
|
53
|
+
"@difizen/libro-rendermime": "^0.3.11",
|
|
54
|
+
"@difizen/libro-search": "^0.3.11",
|
|
55
|
+
"@difizen/libro-search-code-cell": "^0.3.11",
|
|
56
56
|
"@difizen/mana-app": "latest",
|
|
57
57
|
"@difizen/mana-l10n": "latest",
|
|
58
58
|
"uuid": "^9.0.0",
|
|
@@ -87,18 +87,8 @@ export class LibroJupyterCommandContribution implements CommandContribution {
|
|
|
87
87
|
command,
|
|
88
88
|
NotebookCommands['SideToolbarRunSelect'],
|
|
89
89
|
{
|
|
90
|
-
execute: async (
|
|
91
|
-
|
|
92
|
-
!cell ||
|
|
93
|
-
!libro ||
|
|
94
|
-
!(cell instanceof LibroCellView) ||
|
|
95
|
-
!(libro instanceof LibroView)
|
|
96
|
-
) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if ((libro.model as LibroModel).executable) {
|
|
100
|
-
libro.runCell(cell);
|
|
101
|
-
}
|
|
90
|
+
execute: async () => {
|
|
91
|
+
//
|
|
102
92
|
},
|
|
103
93
|
isVisible: (cell, libro, path) => {
|
|
104
94
|
if (
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { PlayCircleOutlined } from '@ant-design/icons';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
LibroSideToolbarMenuItemType,
|
|
4
|
+
LibroToolbarArags,
|
|
5
|
+
LibroView,
|
|
6
|
+
} from '@difizen/libro-core';
|
|
3
7
|
import { NotebookCommands, LibroSideToolbarMenu } from '@difizen/libro-core';
|
|
4
8
|
import { ServerManager } from '@difizen/libro-kernel';
|
|
5
|
-
import {
|
|
9
|
+
import type { Toolbar } from '@difizen/mana-app';
|
|
10
|
+
import {
|
|
11
|
+
ConfigurationService,
|
|
12
|
+
useInject,
|
|
13
|
+
ViewInstance,
|
|
14
|
+
CommandRegistry,
|
|
15
|
+
ToolbarInstance,
|
|
16
|
+
getOrigin,
|
|
17
|
+
} from '@difizen/mana-app';
|
|
6
18
|
import { l10n } from '@difizen/mana-l10n';
|
|
7
19
|
import { Popover, Tooltip } from 'antd';
|
|
8
20
|
import { useEffect, useState } from 'react';
|
|
@@ -16,6 +28,10 @@ export const SideToolbarRunSelector: React.FC = () => {
|
|
|
16
28
|
const libroServerManager = useInject(ServerManager);
|
|
17
29
|
const configService = useInject<ConfigurationService>(ConfigurationService);
|
|
18
30
|
const libroModel = libroView ? libroView.model : undefined;
|
|
31
|
+
const command = useInject(CommandRegistry);
|
|
32
|
+
const toolbar = useInject<Toolbar>(ToolbarInstance);
|
|
33
|
+
const data = toolbar.currentArgs as LibroToolbarArags;
|
|
34
|
+
const args = getOrigin(data) || [];
|
|
19
35
|
const items: LibroSideToolbarMenuItemType[] = [
|
|
20
36
|
{
|
|
21
37
|
id: NotebookCommands['RunCell'].id,
|
|
@@ -80,7 +96,11 @@ export const SideToolbarRunSelector: React.FC = () => {
|
|
|
80
96
|
trigger="hover"
|
|
81
97
|
overlayClassName="libro-popover-side-toolbar-menu libro-side-toolbar-run-select-menu"
|
|
82
98
|
>
|
|
83
|
-
<PlayCircleOutlined
|
|
99
|
+
<PlayCircleOutlined
|
|
100
|
+
onClick={() => {
|
|
101
|
+
command.executeCommand(NotebookCommands['RunCell'].id, ...args);
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
84
104
|
</Popover>
|
|
85
105
|
);
|
|
86
106
|
}
|