@difizen/libro-jupyter 0.1.28 → 0.1.30
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/file/file-create-modal.d.ts.map +1 -1
- package/es/file/file-create-modal.js +16 -5
- package/es/file/file-service.js +1 -1
- package/es/file/index.d.ts +1 -0
- package/es/file/index.d.ts.map +1 -1
- package/es/file/index.js +2 -1
- package/es/keybind-instructions/index.less +9 -4
- package/package.json +17 -17
- package/src/file/file-create-modal.tsx +10 -1
- package/src/file/file-service.ts +1 -1
- package/src/file/index.ts +1 -0
- package/src/keybind-instructions/index.less +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-create-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-create-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-create-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-create-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnE,OAAO,cAAc,CAAC;AAWtB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhE,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAkK5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
|
|
@@ -8,6 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { CommandRegistry } from '@difizen/mana-app';
|
|
11
12
|
import { URI, useInject, ViewManager } from '@difizen/mana-app';
|
|
12
13
|
import { Col, Form, message, Row, Input, Modal } from 'antd';
|
|
13
14
|
import { useEffect, useRef, useState } from 'react';
|
|
@@ -20,6 +21,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
|
|
|
20
21
|
close = _ref.close,
|
|
21
22
|
data = _ref.data;
|
|
22
23
|
var fileService = useInject(JupyterFileService);
|
|
24
|
+
var commands = useInject(CommandRegistry);
|
|
23
25
|
var viewManager = useInject(ViewManager);
|
|
24
26
|
var _useState = useState(data === null || data === void 0 ? void 0 : data.fileType),
|
|
25
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -35,6 +37,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
|
|
|
35
37
|
form = _Form$useForm2[0];
|
|
36
38
|
var onFinish = /*#__PURE__*/function () {
|
|
37
39
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
40
|
+
var stat;
|
|
38
41
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
42
|
while (1) switch (_context.prev = _context.next) {
|
|
40
43
|
case 0:
|
|
@@ -46,20 +49,28 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
|
|
|
46
49
|
_context.next = 6;
|
|
47
50
|
return fileService.newFile(values.fileName + (fileType || ''), new URI(data === null || data === void 0 ? void 0 : data.path));
|
|
48
51
|
case 6:
|
|
52
|
+
stat = _context.sent;
|
|
49
53
|
if (fileView) {
|
|
50
54
|
fileView.model.refresh();
|
|
51
55
|
}
|
|
52
|
-
|
|
56
|
+
if (stat.isFile) {
|
|
57
|
+
commands.executeCommand('fileTree.command.openfile', {
|
|
58
|
+
fileStat: stat,
|
|
59
|
+
uri: stat.resource
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// message.success('新建文件成功');
|
|
63
|
+
_context.next = 14;
|
|
53
64
|
break;
|
|
54
|
-
case
|
|
55
|
-
_context.prev =
|
|
65
|
+
case 11:
|
|
66
|
+
_context.prev = 11;
|
|
56
67
|
_context.t0 = _context["catch"](3);
|
|
57
68
|
message.error('新建文件失败');
|
|
58
|
-
case
|
|
69
|
+
case 14:
|
|
59
70
|
case "end":
|
|
60
71
|
return _context.stop();
|
|
61
72
|
}
|
|
62
|
-
}, _callee, null, [[3,
|
|
73
|
+
}, _callee, null, [[3, 11]]);
|
|
63
74
|
}));
|
|
64
75
|
return function onFinish(_x) {
|
|
65
76
|
return _ref2.apply(this, arguments);
|
package/es/file/file-service.js
CHANGED
|
@@ -390,7 +390,7 @@ export var JupyterFileService = (_dec = singleton({
|
|
|
390
390
|
_context10.next = 13;
|
|
391
391
|
return this.rename(new URI(res.path.toString()), fileName);
|
|
392
392
|
case 13:
|
|
393
|
-
return _context10.abrupt("return", this.resolve(
|
|
393
|
+
return _context10.abrupt("return", this.resolve(targetFileUri));
|
|
394
394
|
case 14:
|
|
395
395
|
case "end":
|
|
396
396
|
return _context10.stop();
|
package/es/file/index.d.ts
CHANGED
package/es/file/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
|
package/es/file/index.js
CHANGED
|
@@ -6,4 +6,5 @@ export * from "./file-service.js";
|
|
|
6
6
|
export * from "./file-protocol.js";
|
|
7
7
|
export * from "./file-icon.js";
|
|
8
8
|
export * from "./file-create-modal.js";
|
|
9
|
-
export * from "./file-createdir-modal.js";
|
|
9
|
+
export * from "./file-createdir-modal.js";
|
|
10
|
+
export * from "./file-command.js";
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
.@{ant-prefix}-input-group-wrapper {
|
|
8
8
|
background-color: var(--mana-libro-filtered-background-color) !important;
|
|
9
9
|
border-radius: 6px;
|
|
10
|
+
.@{ant-prefix}-input {
|
|
11
|
+
color: var(--mana-libro-drawer-title-color);
|
|
12
|
+
|
|
13
|
+
&::placeholder {
|
|
14
|
+
color: var(--mana-libro-keybind-tag-text-color);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
10
17
|
}
|
|
11
18
|
|
|
12
19
|
.@{ant-prefix}-input-group-addon {
|
|
@@ -19,6 +26,7 @@
|
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
.libro-keybind-instructions-drawer {
|
|
29
|
+
background: var(--mana-libro-popover-background-color) !important;
|
|
22
30
|
.@{ant-prefix}-drawer-content-wrapper {
|
|
23
31
|
box-shadow:
|
|
24
32
|
0 0 16px -8px rgba(0, 0, 0, 8%),
|
|
@@ -42,9 +50,6 @@
|
|
|
42
50
|
.@{ant-prefix}-drawer-mask {
|
|
43
51
|
opacity: 0;
|
|
44
52
|
}
|
|
45
|
-
.@{ant-prefix}-drawer-content {
|
|
46
|
-
background: var(--mana-libro-popover-background-color);
|
|
47
|
-
}
|
|
48
53
|
.@{ant-prefix}-drawer-close {
|
|
49
54
|
color: var(--mana-libro-drawer-close-color);
|
|
50
55
|
}
|
|
@@ -135,6 +140,7 @@
|
|
|
135
140
|
.libro-magic-table {
|
|
136
141
|
.@{ant-prefix}-table-thead > tr > th {
|
|
137
142
|
background: var(--mana-libro-popover-background-color);
|
|
143
|
+
color: var(--mana-libro-table-title-color);
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
.@{ant-prefix}-table-tbody > tr.@{ant-prefix}-table-row:hover > td {
|
|
@@ -148,7 +154,6 @@
|
|
|
148
154
|
|
|
149
155
|
thead tr th {
|
|
150
156
|
height: 30px;
|
|
151
|
-
color: var(--mana-libro-table-title-color);
|
|
152
157
|
font-weight: 600;
|
|
153
158
|
font-size: 14px;
|
|
154
159
|
font-family: PingFangSC;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro"
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"src"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@difizen/libro-cofine-editor": "^0.1.
|
|
35
|
-
"@difizen/libro-code-editor": "^0.1.
|
|
36
|
-
"@difizen/libro-code-cell": "^0.1.
|
|
37
|
-
"@difizen/libro-codemirror": "^0.1.
|
|
38
|
-
"@difizen/libro-rendermime": "^0.1.
|
|
39
|
-
"@difizen/libro-common": "^0.1.
|
|
40
|
-
"@difizen/libro-core": "^0.1.
|
|
41
|
-
"@difizen/libro-kernel": "^0.1.
|
|
42
|
-
"@difizen/libro-l10n": "^0.1.
|
|
43
|
-
"@difizen/libro-output": "^0.1.
|
|
44
|
-
"@difizen/libro-search": "^0.1.
|
|
45
|
-
"@difizen/libro-search-code-cell": "^0.1.
|
|
46
|
-
"@difizen/libro-lsp": "^0.1.
|
|
47
|
-
"@difizen/libro-markdown-cell": "^0.1.
|
|
48
|
-
"@difizen/libro-raw-cell": "^0.1.
|
|
49
|
-
"@difizen/libro-language-client": "^0.1.
|
|
34
|
+
"@difizen/libro-cofine-editor": "^0.1.30",
|
|
35
|
+
"@difizen/libro-code-editor": "^0.1.30",
|
|
36
|
+
"@difizen/libro-code-cell": "^0.1.30",
|
|
37
|
+
"@difizen/libro-codemirror": "^0.1.30",
|
|
38
|
+
"@difizen/libro-rendermime": "^0.1.30",
|
|
39
|
+
"@difizen/libro-common": "^0.1.30",
|
|
40
|
+
"@difizen/libro-core": "^0.1.30",
|
|
41
|
+
"@difizen/libro-kernel": "^0.1.30",
|
|
42
|
+
"@difizen/libro-l10n": "^0.1.30",
|
|
43
|
+
"@difizen/libro-output": "^0.1.30",
|
|
44
|
+
"@difizen/libro-search": "^0.1.30",
|
|
45
|
+
"@difizen/libro-search-code-cell": "^0.1.30",
|
|
46
|
+
"@difizen/libro-lsp": "^0.1.30",
|
|
47
|
+
"@difizen/libro-markdown-cell": "^0.1.30",
|
|
48
|
+
"@difizen/libro-raw-cell": "^0.1.30",
|
|
49
|
+
"@difizen/libro-language-client": "^0.1.30",
|
|
50
50
|
"@difizen/mana-app": "latest",
|
|
51
51
|
"@difizen/mana-l10n": "latest",
|
|
52
52
|
"@ant-design/colors": "^7.0.0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ModalItemProps, ModalItem } from '@difizen/mana-app';
|
|
2
|
+
import { CommandRegistry } from '@difizen/mana-app';
|
|
2
3
|
import { URI, useInject, ViewManager } from '@difizen/mana-app';
|
|
3
4
|
import { Col, Form, message, Row, Input, Modal } from 'antd';
|
|
4
5
|
import type { InputRef } from 'antd';
|
|
@@ -27,6 +28,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
|
|
|
27
28
|
data,
|
|
28
29
|
}: ModalItemProps<ModalItemType>) => {
|
|
29
30
|
const fileService = useInject(JupyterFileService);
|
|
31
|
+
const commands = useInject(CommandRegistry);
|
|
30
32
|
const viewManager = useInject(ViewManager);
|
|
31
33
|
const [fileType, setFileType] = useState<FileType>(data?.fileType);
|
|
32
34
|
const [fileView, setFileView] = useState<FileView>();
|
|
@@ -37,13 +39,20 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
|
|
|
37
39
|
await form.validateFields();
|
|
38
40
|
close();
|
|
39
41
|
try {
|
|
40
|
-
await fileService.newFile(
|
|
42
|
+
const stat = await fileService.newFile(
|
|
41
43
|
values.fileName + (fileType || ''),
|
|
42
44
|
new URI(data?.path),
|
|
43
45
|
);
|
|
44
46
|
if (fileView) {
|
|
45
47
|
fileView.model.refresh();
|
|
46
48
|
}
|
|
49
|
+
if (stat.isFile) {
|
|
50
|
+
commands.executeCommand('fileTree.command.openfile', {
|
|
51
|
+
fileStat: stat,
|
|
52
|
+
uri: stat.resource,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// message.success('新建文件成功');
|
|
47
56
|
} catch {
|
|
48
57
|
message.error('新建文件失败');
|
|
49
58
|
}
|
package/src/file/file-service.ts
CHANGED
|
@@ -205,7 +205,7 @@ export class JupyterFileService extends FileService {
|
|
|
205
205
|
ext,
|
|
206
206
|
});
|
|
207
207
|
await this.rename(new URI(res.path.toString()), fileName);
|
|
208
|
-
return this.resolve(
|
|
208
|
+
return this.resolve(targetFileUri);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
async newFileDir(dirName: string, target: URI): Promise<FileStatWithMetadata> {
|
package/src/file/index.ts
CHANGED
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
.@{ant-prefix}-input-group-wrapper {
|
|
8
8
|
background-color: var(--mana-libro-filtered-background-color) !important;
|
|
9
9
|
border-radius: 6px;
|
|
10
|
+
.@{ant-prefix}-input {
|
|
11
|
+
color: var(--mana-libro-drawer-title-color);
|
|
12
|
+
|
|
13
|
+
&::placeholder {
|
|
14
|
+
color: var(--mana-libro-keybind-tag-text-color);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
10
17
|
}
|
|
11
18
|
|
|
12
19
|
.@{ant-prefix}-input-group-addon {
|
|
@@ -19,6 +26,7 @@
|
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
.libro-keybind-instructions-drawer {
|
|
29
|
+
background: var(--mana-libro-popover-background-color) !important;
|
|
22
30
|
.@{ant-prefix}-drawer-content-wrapper {
|
|
23
31
|
box-shadow:
|
|
24
32
|
0 0 16px -8px rgba(0, 0, 0, 8%),
|
|
@@ -42,9 +50,6 @@
|
|
|
42
50
|
.@{ant-prefix}-drawer-mask {
|
|
43
51
|
opacity: 0;
|
|
44
52
|
}
|
|
45
|
-
.@{ant-prefix}-drawer-content {
|
|
46
|
-
background: var(--mana-libro-popover-background-color);
|
|
47
|
-
}
|
|
48
53
|
.@{ant-prefix}-drawer-close {
|
|
49
54
|
color: var(--mana-libro-drawer-close-color);
|
|
50
55
|
}
|
|
@@ -135,6 +140,7 @@
|
|
|
135
140
|
.libro-magic-table {
|
|
136
141
|
.@{ant-prefix}-table-thead > tr > th {
|
|
137
142
|
background: var(--mana-libro-popover-background-color);
|
|
143
|
+
color: var(--mana-libro-table-title-color);
|
|
138
144
|
}
|
|
139
145
|
|
|
140
146
|
.@{ant-prefix}-table-tbody > tr.@{ant-prefix}-table-row:hover > td {
|
|
@@ -148,7 +154,6 @@
|
|
|
148
154
|
|
|
149
155
|
thead tr th {
|
|
150
156
|
height: 30px;
|
|
151
|
-
color: var(--mana-libro-table-title-color);
|
|
152
157
|
font-weight: 600;
|
|
153
158
|
font-size: 14px;
|
|
154
159
|
font-family: PingFangSC;
|