@difizen/libro-jupyter 0.1.31 → 0.1.33
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/components/icons.js +1 -1
- package/es/keybind-instructions/index.less +0 -5
- package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -1
- package/es/keybind-instructions/keybind-instructions-view.js +67 -61
- package/es/toolbar/save-file-error.d.ts.map +1 -1
- package/es/toolbar/save-file-error.js +20 -13
- package/package.json +18 -18
- package/src/components/icons.tsx +1 -1
- package/src/keybind-instructions/index.less +0 -5
- package/src/keybind-instructions/keybind-instructions-view.tsx +70 -60
- package/src/toolbar/save-file-error.tsx +25 -15
package/es/components/icons.js
CHANGED
|
@@ -134,7 +134,7 @@ export var Location = function Location() {
|
|
|
134
134
|
children: /*#__PURE__*/_jsx("g", {
|
|
135
135
|
id: "2.0-kernel-\u542F\u52A8\u524D",
|
|
136
136
|
transform: "translate(-738.000000, -80.000000)",
|
|
137
|
-
fill: "
|
|
137
|
+
fill: "currentColor"
|
|
138
138
|
// fillRule="nonzero"
|
|
139
139
|
,
|
|
140
140
|
children: /*#__PURE__*/_jsx("g", {
|
|
@@ -42,11 +42,6 @@
|
|
|
42
42
|
.@{ant-prefix}-segmented-item-label {
|
|
43
43
|
color: var(--mana-libro-drawer-title-color);
|
|
44
44
|
}
|
|
45
|
-
.@{ant-prefix}-segmented-item-selected {
|
|
46
|
-
.@{ant-prefix}-segmented-item-label {
|
|
47
|
-
color: rgba(0, 10, 26, 89%);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
45
|
.@{ant-prefix}-drawer-mask {
|
|
51
46
|
opacity: 0;
|
|
52
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keybind-instructions-view.d.ts","sourceRoot":"","sources":["../../src/keybind-instructions/keybind-instructions-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,cAAc,CAAC;AAsCtB,qBACa,yBAA0B,YAAW,UAAU;IACjC,UAAU,EAAE,eAAe,CAAC;IACrD,yBAAyB,UAAS;IAC1B,qBAAqB,EAAE,QAAQ,EAAE,CAAM;IACvC,kBAAkB,EAAE,QAAQ,EAAE,CAAM;IAE5C,OAAO;CAIR;AAiED,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"keybind-instructions-view.d.ts","sourceRoot":"","sources":["../../src/keybind-instructions/keybind-instructions-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,cAAc,CAAC;AAsCtB,qBACa,yBAA0B,YAAW,UAAU;IACjC,UAAU,EAAE,eAAe,CAAC;IACrD,yBAAyB,UAAS;IAC1B,qBAAqB,EAAE,QAAQ,EAAE,CAAM;IACvC,kBAAkB,EAAE,QAAQ,EAAE,CAAM;IAE5C,OAAO;CAIR;AAiED,eAAO,MAAM,2BAA2B,iHAsHtC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,SAGpC,CAAC"}
|
|
@@ -15,10 +15,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
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; }
|
|
16
16
|
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.'); }
|
|
17
17
|
import { LibroContextKey } from '@difizen/libro-core';
|
|
18
|
-
import { inject, singleton } from '@difizen/mana-app';
|
|
18
|
+
import { inject, singleton, ThemeService } from '@difizen/mana-app';
|
|
19
19
|
import { getOrigin, prop, useInject } from '@difizen/mana-app';
|
|
20
20
|
import { l10n } from '@difizen/mana-l10n';
|
|
21
|
-
import { Input, Drawer, Table, Segmented } from 'antd';
|
|
21
|
+
import { Input, Drawer, Table, Segmented, ConfigProvider, theme } from 'antd';
|
|
22
22
|
import { forwardRef, useCallback, useState } from 'react';
|
|
23
23
|
import { LibroKeybindItems } from "./keybind-instructions-items.js";
|
|
24
24
|
import "./index.less";
|
|
@@ -137,6 +137,7 @@ export var KeybindInstrutionsComponent = /*#__PURE__*/forwardRef(function Keybin
|
|
|
137
137
|
segment = _useState2[0],
|
|
138
138
|
setSegment = _useState2[1];
|
|
139
139
|
var keybindInstrutionsService = useInject(KeybindInstrutionsService);
|
|
140
|
+
var themeService = useInject(ThemeService);
|
|
140
141
|
var libroKeybindItems = useInject(LibroKeybindItems);
|
|
141
142
|
var handleClose = useCallback(function () {
|
|
142
143
|
close();
|
|
@@ -151,70 +152,75 @@ export var KeybindInstrutionsComponent = /*#__PURE__*/forwardRef(function Keybin
|
|
|
151
152
|
};
|
|
152
153
|
var commandModeDataSource = getOrigin(keybindInstrutionsService.searchCommandModeData.length > 0 ? keybindInstrutionsService.searchCommandModeData : libroKeybindItems.commandModeData);
|
|
153
154
|
var editModeDataSource = getOrigin(keybindInstrutionsService.searchEditModeData.length > 0 ? keybindInstrutionsService.searchEditModeData : libroKeybindItems.editModeData);
|
|
154
|
-
return /*#__PURE__*/_jsx(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
children: /*#__PURE__*/_jsx(Search, {
|
|
191
|
-
placeholder: l10n.t('搜索功能关键字'),
|
|
192
|
-
allowClear: true,
|
|
193
|
-
bordered: false,
|
|
194
|
-
size: "middle",
|
|
195
|
-
onSearch: handleSearch
|
|
155
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
156
|
+
theme: {
|
|
157
|
+
algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
|
|
158
|
+
},
|
|
159
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
160
|
+
className: "libro-keybind-instructions-command",
|
|
161
|
+
ref: ref,
|
|
162
|
+
children: /*#__PURE__*/_jsxs(Drawer, {
|
|
163
|
+
title: /*#__PURE__*/_jsx(Segmented, {
|
|
164
|
+
value: segment,
|
|
165
|
+
onChange: function onChange(value) {
|
|
166
|
+
return setSegment(value);
|
|
167
|
+
},
|
|
168
|
+
options: [{
|
|
169
|
+
label: l10n.t('快捷键'),
|
|
170
|
+
value: 'keybind'
|
|
171
|
+
}, {
|
|
172
|
+
label: 'Magic 命令',
|
|
173
|
+
value: 'magic'
|
|
174
|
+
}]
|
|
175
|
+
}),
|
|
176
|
+
placement: "right",
|
|
177
|
+
onClose: handleClose,
|
|
178
|
+
width: "360px",
|
|
179
|
+
open: visible,
|
|
180
|
+
mask: true,
|
|
181
|
+
className: "libro-keybind-instructions-drawer",
|
|
182
|
+
maskClosable: true,
|
|
183
|
+
children: [segment === 'magic' && /*#__PURE__*/_jsx("div", {
|
|
184
|
+
className: "libro-magic-table",
|
|
185
|
+
children: /*#__PURE__*/_jsx(Table, {
|
|
186
|
+
size: "small",
|
|
187
|
+
columns: magicColumns,
|
|
188
|
+
dataSource: magics,
|
|
189
|
+
pagination: false,
|
|
190
|
+
rowKey: "key"
|
|
196
191
|
})
|
|
197
|
-
}), /*#__PURE__*/_jsxs(
|
|
198
|
-
className: "libro-keybind-instructions-table",
|
|
192
|
+
}), segment === 'keybind' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
199
193
|
children: [/*#__PURE__*/_jsx("div", {
|
|
200
|
-
className: "libro-
|
|
201
|
-
children: /*#__PURE__*/_jsx(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
208
|
-
className: "libro-edit-mode-keybind-instructions-table",
|
|
209
|
-
children: /*#__PURE__*/_jsx(Table, {
|
|
210
|
-
rowKey: "key",
|
|
211
|
-
columns: libroKeybindItems.editModeActionColumns,
|
|
212
|
-
dataSource: editModeDataSource,
|
|
213
|
-
pagination: false
|
|
194
|
+
className: "libro-keybind-instructions-command-search",
|
|
195
|
+
children: /*#__PURE__*/_jsx(Search, {
|
|
196
|
+
placeholder: l10n.t('搜索功能关键字'),
|
|
197
|
+
allowClear: true,
|
|
198
|
+
bordered: false,
|
|
199
|
+
size: "middle",
|
|
200
|
+
onSearch: handleSearch
|
|
214
201
|
})
|
|
202
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
203
|
+
className: "libro-keybind-instructions-table",
|
|
204
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
205
|
+
className: "libro-command-mode-keybind-instructions-table",
|
|
206
|
+
children: /*#__PURE__*/_jsx(Table, {
|
|
207
|
+
rowKey: "key",
|
|
208
|
+
columns: libroKeybindItems.commandModeActionColumns,
|
|
209
|
+
dataSource: commandModeDataSource,
|
|
210
|
+
pagination: false
|
|
211
|
+
})
|
|
212
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
213
|
+
className: "libro-edit-mode-keybind-instructions-table",
|
|
214
|
+
children: /*#__PURE__*/_jsx(Table, {
|
|
215
|
+
rowKey: "key",
|
|
216
|
+
columns: libroKeybindItems.editModeActionColumns,
|
|
217
|
+
dataSource: editModeDataSource,
|
|
218
|
+
pagination: false
|
|
219
|
+
})
|
|
220
|
+
})]
|
|
215
221
|
})]
|
|
216
222
|
})]
|
|
217
|
-
})
|
|
223
|
+
})
|
|
218
224
|
})
|
|
219
225
|
});
|
|
220
226
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-file-error.d.ts","sourceRoot":"","sources":["../../src/toolbar/save-file-error.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"save-file-error.d.ts","sourceRoot":"","sources":["../../src/toolbar/save-file-error.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnE,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CA+BjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAGhC,CAAC"}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
+
import { ThemeService } from '@difizen/mana-app';
|
|
1
2
|
import { useInject, ViewInstance } from '@difizen/mana-app';
|
|
2
|
-
import { Modal } from 'antd';
|
|
3
|
+
import { ConfigProvider, Modal, theme } from 'antd';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export var SaveFileModalComponent = function SaveFileModalComponent(_ref) {
|
|
5
6
|
var visible = _ref.visible,
|
|
6
7
|
close = _ref.close;
|
|
7
8
|
var libroView = useInject(ViewInstance);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return close();
|
|
9
|
+
var themeService = useInject(ThemeService);
|
|
10
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
11
|
+
theme: {
|
|
12
|
+
algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
children: /*#__PURE__*/_jsx(Modal, {
|
|
15
|
+
title: "File Save Error",
|
|
16
|
+
open: visible,
|
|
17
|
+
onOk: function onOk() {
|
|
18
|
+
return close();
|
|
19
|
+
},
|
|
20
|
+
onCancel: function onCancel() {
|
|
21
|
+
return close();
|
|
22
|
+
},
|
|
23
|
+
width: '400px',
|
|
24
|
+
centered: true,
|
|
25
|
+
children: /*#__PURE__*/_jsx("p", {
|
|
26
|
+
children: "File Save Error for: \"".concat(libroView && libroView.model ? libroView.model.currentFileContents.name : '', "\"")
|
|
27
|
+
})
|
|
21
28
|
})
|
|
22
29
|
});
|
|
23
30
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro"
|
|
@@ -31,23 +31,23 @@
|
|
|
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.
|
|
50
|
-
"@difizen/libro-widget": "^0.1.
|
|
34
|
+
"@difizen/libro-cofine-editor": "^0.1.33",
|
|
35
|
+
"@difizen/libro-code-editor": "^0.1.33",
|
|
36
|
+
"@difizen/libro-code-cell": "^0.1.33",
|
|
37
|
+
"@difizen/libro-codemirror": "^0.1.33",
|
|
38
|
+
"@difizen/libro-rendermime": "^0.1.33",
|
|
39
|
+
"@difizen/libro-common": "^0.1.33",
|
|
40
|
+
"@difizen/libro-core": "^0.1.33",
|
|
41
|
+
"@difizen/libro-kernel": "^0.1.33",
|
|
42
|
+
"@difizen/libro-l10n": "^0.1.33",
|
|
43
|
+
"@difizen/libro-output": "^0.1.33",
|
|
44
|
+
"@difizen/libro-search": "^0.1.33",
|
|
45
|
+
"@difizen/libro-search-code-cell": "^0.1.33",
|
|
46
|
+
"@difizen/libro-lsp": "^0.1.33",
|
|
47
|
+
"@difizen/libro-markdown-cell": "^0.1.33",
|
|
48
|
+
"@difizen/libro-raw-cell": "^0.1.33",
|
|
49
|
+
"@difizen/libro-language-client": "^0.1.33",
|
|
50
|
+
"@difizen/libro-widget": "^0.1.33",
|
|
51
51
|
"@difizen/mana-app": "latest",
|
|
52
52
|
"@difizen/mana-l10n": "latest",
|
|
53
53
|
"@ant-design/colors": "^7.0.0",
|
package/src/components/icons.tsx
CHANGED
|
@@ -100,7 +100,7 @@ export const Location: React.FC = () => (
|
|
|
100
100
|
<g
|
|
101
101
|
id="2.0-kernel-启动前"
|
|
102
102
|
transform="translate(-738.000000, -80.000000)"
|
|
103
|
-
fill="
|
|
103
|
+
fill="currentColor"
|
|
104
104
|
// fillRule="nonzero"
|
|
105
105
|
>
|
|
106
106
|
<g id="编组-24" transform="translate(637.000000, 80.000000)">
|
|
@@ -42,11 +42,6 @@
|
|
|
42
42
|
.@{ant-prefix}-segmented-item-label {
|
|
43
43
|
color: var(--mana-libro-drawer-title-color);
|
|
44
44
|
}
|
|
45
|
-
.@{ant-prefix}-segmented-item-selected {
|
|
46
|
-
.@{ant-prefix}-segmented-item-label {
|
|
47
|
-
color: rgba(0, 10, 26, 89%);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
45
|
.@{ant-prefix}-drawer-mask {
|
|
51
46
|
opacity: 0;
|
|
52
47
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LibroContextKey } from '@difizen/libro-core';
|
|
2
|
-
import { inject, singleton } from '@difizen/mana-app';
|
|
2
|
+
import { inject, singleton, ThemeService } from '@difizen/mana-app';
|
|
3
3
|
import { getOrigin, prop, useInject } from '@difizen/mana-app';
|
|
4
4
|
import type { ModalItem, ModalItemProps } from '@difizen/mana-app';
|
|
5
5
|
import type { Disposable } from '@difizen/mana-app';
|
|
6
6
|
import { l10n } from '@difizen/mana-l10n';
|
|
7
|
-
import { Input, Drawer, Table, Segmented } from 'antd';
|
|
7
|
+
import { Input, Drawer, Table, Segmented, ConfigProvider, theme } from 'antd';
|
|
8
8
|
import { forwardRef, useCallback, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import type { DataType } from './keybind-instructions-items.js';
|
|
@@ -132,6 +132,7 @@ export const KeybindInstrutionsComponent = forwardRef<
|
|
|
132
132
|
const keybindInstrutionsService = useInject<KeybindInstrutionsService>(
|
|
133
133
|
KeybindInstrutionsService,
|
|
134
134
|
);
|
|
135
|
+
const themeService = useInject(ThemeService);
|
|
135
136
|
const libroKeybindItems = useInject(LibroKeybindItems);
|
|
136
137
|
const handleClose = useCallback(() => {
|
|
137
138
|
close();
|
|
@@ -166,70 +167,79 @@ export const KeybindInstrutionsComponent = forwardRef<
|
|
|
166
167
|
);
|
|
167
168
|
|
|
168
169
|
return (
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
maskClosable={true}
|
|
188
|
-
>
|
|
189
|
-
{segment === 'magic' && (
|
|
190
|
-
<div className="libro-magic-table">
|
|
191
|
-
<Table
|
|
192
|
-
size="small"
|
|
193
|
-
columns={magicColumns}
|
|
194
|
-
dataSource={magics}
|
|
195
|
-
pagination={false}
|
|
196
|
-
rowKey="key"
|
|
170
|
+
<ConfigProvider
|
|
171
|
+
theme={{
|
|
172
|
+
algorithm:
|
|
173
|
+
themeService.getCurrentTheme().type === 'dark'
|
|
174
|
+
? theme.darkAlgorithm
|
|
175
|
+
: theme.defaultAlgorithm,
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
<div className="libro-keybind-instructions-command" ref={ref}>
|
|
179
|
+
<Drawer
|
|
180
|
+
title={
|
|
181
|
+
<Segmented
|
|
182
|
+
value={segment}
|
|
183
|
+
onChange={(value) => setSegment(value as Segment)}
|
|
184
|
+
options={[
|
|
185
|
+
{ label: l10n.t('快捷键'), value: 'keybind' },
|
|
186
|
+
{ label: 'Magic 命令', value: 'magic' },
|
|
187
|
+
]}
|
|
197
188
|
/>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
189
|
+
}
|
|
190
|
+
placement="right"
|
|
191
|
+
onClose={handleClose}
|
|
192
|
+
width="360px"
|
|
193
|
+
open={visible}
|
|
194
|
+
mask={true}
|
|
195
|
+
className="libro-keybind-instructions-drawer"
|
|
196
|
+
maskClosable={true}
|
|
197
|
+
>
|
|
198
|
+
{segment === 'magic' && (
|
|
199
|
+
<div className="libro-magic-table">
|
|
200
|
+
<Table
|
|
201
|
+
size="small"
|
|
202
|
+
columns={magicColumns}
|
|
203
|
+
dataSource={magics}
|
|
204
|
+
pagination={false}
|
|
205
|
+
rowKey="key"
|
|
209
206
|
/>
|
|
210
207
|
</div>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
)}
|
|
209
|
+
{segment === 'keybind' && (
|
|
210
|
+
<>
|
|
211
|
+
<div className="libro-keybind-instructions-command-search">
|
|
212
|
+
<Search
|
|
213
|
+
placeholder={l10n.t('搜索功能关键字')}
|
|
214
|
+
allowClear
|
|
215
|
+
bordered={false}
|
|
216
|
+
size="middle"
|
|
217
|
+
onSearch={handleSearch}
|
|
218
218
|
/>
|
|
219
219
|
</div>
|
|
220
|
-
<div className="libro-
|
|
221
|
-
<
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
220
|
+
<div className="libro-keybind-instructions-table">
|
|
221
|
+
<div className="libro-command-mode-keybind-instructions-table">
|
|
222
|
+
<Table
|
|
223
|
+
rowKey="key"
|
|
224
|
+
columns={libroKeybindItems.commandModeActionColumns}
|
|
225
|
+
dataSource={commandModeDataSource}
|
|
226
|
+
pagination={false}
|
|
227
|
+
/>
|
|
228
|
+
</div>
|
|
229
|
+
<div className="libro-edit-mode-keybind-instructions-table">
|
|
230
|
+
<Table
|
|
231
|
+
rowKey="key"
|
|
232
|
+
columns={libroKeybindItems.editModeActionColumns}
|
|
233
|
+
dataSource={editModeDataSource}
|
|
234
|
+
pagination={false}
|
|
235
|
+
/>
|
|
236
|
+
</div>
|
|
227
237
|
</div>
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
</
|
|
232
|
-
</
|
|
238
|
+
</>
|
|
239
|
+
)}
|
|
240
|
+
</Drawer>
|
|
241
|
+
</div>
|
|
242
|
+
</ConfigProvider>
|
|
233
243
|
);
|
|
234
244
|
});
|
|
235
245
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { LibroView } from '@difizen/libro-core';
|
|
2
2
|
import type { ModalItemProps, ModalItem } from '@difizen/mana-app';
|
|
3
|
+
import { ThemeService } from '@difizen/mana-app';
|
|
3
4
|
import { useInject, ViewInstance } from '@difizen/mana-app';
|
|
4
|
-
import { Modal } from 'antd';
|
|
5
|
+
import { ConfigProvider, Modal, theme } from 'antd';
|
|
5
6
|
|
|
6
7
|
import type { LibroJupyterModel } from '../libro-jupyter-model.js';
|
|
7
8
|
|
|
@@ -10,22 +11,31 @@ export const SaveFileModalComponent: React.FC<ModalItemProps<void>> = ({
|
|
|
10
11
|
close,
|
|
11
12
|
}: ModalItemProps<void>) => {
|
|
12
13
|
const libroView = useInject<LibroView>(ViewInstance);
|
|
13
|
-
|
|
14
|
+
const themeService = useInject(ThemeService);
|
|
14
15
|
return (
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
<ConfigProvider
|
|
17
|
+
theme={{
|
|
18
|
+
algorithm:
|
|
19
|
+
themeService.getCurrentTheme().type === 'dark'
|
|
20
|
+
? theme.darkAlgorithm
|
|
21
|
+
: theme.defaultAlgorithm,
|
|
22
|
+
}}
|
|
22
23
|
>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
<Modal
|
|
25
|
+
title="File Save Error"
|
|
26
|
+
open={visible}
|
|
27
|
+
onOk={() => close()}
|
|
28
|
+
onCancel={() => close()}
|
|
29
|
+
width={'400px'}
|
|
30
|
+
centered={true}
|
|
31
|
+
>
|
|
32
|
+
<p>{`File Save Error for: "${
|
|
33
|
+
libroView && libroView.model
|
|
34
|
+
? (libroView.model as LibroJupyterModel).currentFileContents.name
|
|
35
|
+
: ''
|
|
36
|
+
}"`}</p>
|
|
37
|
+
</Modal>
|
|
38
|
+
</ConfigProvider>
|
|
29
39
|
);
|
|
30
40
|
};
|
|
31
41
|
|