@difizen/libro-jupyter 0.2.35 → 0.2.36

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.
Files changed (48) hide show
  1. package/es/config/config.js +13 -13
  2. package/es/file/file-command.d.ts.map +1 -1
  3. package/es/file/file-command.js +74 -10
  4. package/es/file/file-create-modal.d.ts.map +1 -1
  5. package/es/file/file-create-modal.js +11 -10
  6. package/es/file/file-createdir-modal.d.ts.map +1 -1
  7. package/es/file/file-createdir-modal.js +9 -8
  8. package/es/file/file-icon.d.ts.map +1 -1
  9. package/es/file/file-icon.js +3 -5
  10. package/es/file/file-rename-modal.d.ts.map +1 -1
  11. package/es/file/file-rename-modal.js +6 -5
  12. package/es/file/file-service.d.ts.map +1 -1
  13. package/es/file/file-service.js +3 -2
  14. package/es/file/file-view/index.d.ts.map +1 -1
  15. package/es/file/file-view/index.js +8 -3
  16. package/es/file/utils.d.ts.map +1 -1
  17. package/es/file/utils.js +5 -4
  18. package/es/keybind-instructions/keybind-instructions-items.js +33 -31
  19. package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -1
  20. package/es/keybind-instructions/keybind-instructions-view.js +48 -48
  21. package/es/libro-jupyter-protocol.d.ts.map +1 -1
  22. package/es/libro-jupyter-protocol.js +12 -13
  23. package/es/toolbar/index.less +1 -1
  24. package/es/toolbar/kernel-status-and-selector.d.ts.map +1 -1
  25. package/es/toolbar/kernel-status-and-selector.js +3 -3
  26. package/es/toolbar/run-selector.d.ts.map +1 -1
  27. package/es/toolbar/run-selector.js +1 -1
  28. package/es/toolbar/side-toolbar-run-selector.d.ts.map +1 -1
  29. package/es/toolbar/side-toolbar-run-selector.js +38 -38
  30. package/es/toolbar/toolbar-contribution.js +9 -7
  31. package/package.json +7 -7
  32. package/src/config/config.ts +13 -13
  33. package/src/file/file-command.tsx +24 -8
  34. package/src/file/file-create-modal.tsx +14 -11
  35. package/src/file/file-createdir-modal.tsx +9 -8
  36. package/src/file/file-icon.tsx +0 -1
  37. package/src/file/file-rename-modal.tsx +6 -5
  38. package/src/file/file-service.ts +3 -2
  39. package/src/file/file-view/index.tsx +6 -3
  40. package/src/file/utils.ts +5 -4
  41. package/src/keybind-instructions/keybind-instructions-items.tsx +31 -31
  42. package/src/keybind-instructions/keybind-instructions-view.tsx +66 -63
  43. package/src/libro-jupyter-protocol.ts +12 -13
  44. package/src/toolbar/index.less +1 -1
  45. package/src/toolbar/kernel-status-and-selector.tsx +3 -4
  46. package/src/toolbar/run-selector.tsx +3 -2
  47. package/src/toolbar/side-toolbar-run-selector.tsx +38 -40
  48. package/src/toolbar/toolbar-contribution.tsx +2 -2
@@ -2,7 +2,7 @@ import { l10n } from '@difizen/mana-l10n';
2
2
  export var LibroConfigAutoSave = {
3
3
  id: 'libro.autosave',
4
4
  description: l10n.t('是否自动保存修改'),
5
- title: '自动保存',
5
+ title: l10n.t('自动保存'),
6
6
  type: 'checkbox',
7
7
  defaultValue: false,
8
8
  schema: {
@@ -11,8 +11,8 @@ export var LibroConfigAutoSave = {
11
11
  };
12
12
  export var LibroConfigOpenSlot = {
13
13
  id: 'libro.jupyter.open.slot',
14
- description: '文件默认打开位置',
15
- title: '文件默认打开位置',
14
+ description: l10n.t('文件默认打开位置'),
15
+ title: l10n.t('文件默认打开位置'),
16
16
  type: 'input',
17
17
  defaultValue: 'main',
18
18
  schema: {
@@ -21,8 +21,8 @@ export var LibroConfigOpenSlot = {
21
21
  };
22
22
  export var LibroConfigAllowDownload = {
23
23
  id: 'libro.jupyter.allow.download',
24
- description: '是否允许下载',
25
- title: '允许下载',
24
+ description: l10n.t('是否允许下载'),
25
+ title: l10n.t('允许下载'),
26
26
  type: 'checkbox',
27
27
  defaultValue: true,
28
28
  schema: {
@@ -31,8 +31,8 @@ export var LibroConfigAllowDownload = {
31
31
  };
32
32
  export var LibroConfigAllowUpload = {
33
33
  id: 'libro.jupyter.allow.upload',
34
- description: '是否允许上传',
35
- title: '允许上传',
34
+ description: l10n.t('是否允许上传'),
35
+ title: l10n.t('允许上传'),
36
36
  type: 'checkbox',
37
37
  defaultValue: true,
38
38
  schema: {
@@ -41,8 +41,8 @@ export var LibroConfigAllowUpload = {
41
41
  };
42
42
  export var LibroConfigAllowPreferredSession = {
43
43
  id: 'libro.jupyter.allow.prefer.session',
44
- description: 'kernel切换是否显示Use Kernel from Preferred Session',
45
- title: '允许 Preferred session切换显示',
44
+ description: l10n.t('kernel切换是否显示Use Kernel from Preferred Session'),
45
+ title: l10n.t('允许 Preferred session切换显示'),
46
46
  type: 'checkbox',
47
47
  defaultValue: true,
48
48
  schema: {
@@ -52,9 +52,9 @@ export var LibroConfigAllowPreferredSession = {
52
52
  export var LibroConfigKernelUnreadyText = {
53
53
  id: 'libro.jupyter.kernel.unready.text',
54
54
  description: 'kernel unready text',
55
- title: 'kernel 处于 unready 时左上角提示文案',
55
+ title: l10n.t('kernel 处于 unready 时左上角提示文案'),
56
56
  type: 'string',
57
- defaultValue: 'Kernel 准备中...',
57
+ defaultValue: l10n.t('Kernel 准备中...'),
58
58
  schema: {
59
59
  type: 'string'
60
60
  }
@@ -62,9 +62,9 @@ export var LibroConfigKernelUnreadyText = {
62
62
  export var LibroConfigKernelUnreadyBtnText = {
63
63
  id: 'libro.jupyter.kernel.unready.btn.text',
64
64
  description: 'kernel unready btn text',
65
- title: 'kernel 处于 unready 时执行按钮提示文案',
65
+ title: l10n.t('kernel 处于 unready 时执行按钮提示文案'),
66
66
  type: 'string',
67
- defaultValue: 'kernel准备中,无法执行',
67
+ defaultValue: l10n.t('kernel准备中,无法执行'),
68
68
  schema: {
69
69
  type: 'string'
70
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file-command.d.ts","sourceRoot":"","sources":["../../src/file/file-command.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,eAAe,EAChB,MAAM,mBAAmB,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,EAAE,eAAe,GAAG,IAAI;CAQ7D"}
@@ -19,6 +19,7 @@ import { ReloadOutlined } from '@ant-design/icons';
19
19
  import { ContentsManager } from '@difizen/libro-kernel';
20
20
  import { ViewManager, ConfigurationService } from '@difizen/mana-app';
21
21
  import { CommandContribution, FileStatNode, inject, MenuContribution, ModalService, OpenerService, singleton, ToolbarContribution, URI } from '@difizen/mana-app';
22
+ import { l10n } from '@difizen/mana-l10n';
22
23
  import { message, Modal } from 'antd';
23
24
  import { FileCreateModal } from "./file-create-modal.js";
24
25
  import { FileDirCreateModal } from "./file-createdir-modal.js";
@@ -125,60 +126,121 @@ export var FileCommandContribution = (_dec = singleton({
125
126
  menu.registerMenuAction(FileTreeContextMenuGroups['new'], {
126
127
  id: FileCommands.CREATE_FILE.id,
127
128
  command: FileCommands.CREATE_FILE.id,
129
+ label: function label() {
130
+ return /*#__PURE__*/_jsx("div", {
131
+ children: l10n.t(FileCommands.CREATE_FILE.label)
132
+ });
133
+ },
128
134
  order: 'a'
129
135
  });
130
136
  menu.registerMenuAction(FileTreeContextMenuGroups['new'], {
131
137
  id: FileCommands.CREATE_DIR.id,
132
138
  command: FileCommands.CREATE_DIR.id,
139
+ label: function label() {
140
+ return /*#__PURE__*/_jsx("div", {
141
+ children: l10n.t(FileCommands.CREATE_DIR.label)
142
+ });
143
+ },
133
144
  order: 'a'
134
145
  });
135
146
  menu.registerMenuAction(FileTreeContextMenuGroups['new'], {
136
147
  id: FileCommands.OPEN_FILE.id,
137
148
  command: FileCommands.OPEN_FILE.id,
149
+ label: function label() {
150
+ return /*#__PURE__*/_jsx("div", {
151
+ children: l10n.t(FileCommands.OPEN_FILE.label)
152
+ });
153
+ },
138
154
  order: 'a'
139
155
  });
140
156
  menu.registerMenuAction(FileTreeContextMenuGroups['operator'], {
141
157
  id: FileCommands.COPY.id,
142
158
  command: FileCommands.COPY.id,
159
+ label: function label() {
160
+ return /*#__PURE__*/_jsx("div", {
161
+ children: l10n.t(FileCommands.COPY.label)
162
+ });
163
+ },
143
164
  order: 'b'
144
165
  });
145
166
  menu.registerMenuAction(FileTreeContextMenuGroups['operator'], {
146
167
  id: FileCommands.PASTE.id,
147
168
  command: FileCommands.PASTE.id,
169
+ label: function label() {
170
+ return /*#__PURE__*/_jsx("div", {
171
+ children: l10n.t(FileCommands.PASTE.label)
172
+ });
173
+ },
148
174
  order: 'c'
149
175
  });
150
176
  menu.registerMenuAction(FileTreeContextMenuGroups['operator'], {
151
177
  id: FileCommands.CUT.id,
152
178
  command: FileCommands.CUT.id,
179
+ label: function label() {
180
+ return /*#__PURE__*/_jsx("div", {
181
+ children: l10n.t(FileCommands.CUT.label)
182
+ });
183
+ },
153
184
  order: 'd'
154
185
  });
155
- menu.registerMenuAction(FileTreeContextMenuGroups['change'], _objectSpread({
186
+ menu.registerMenuAction(FileTreeContextMenuGroups['change'], _objectSpread(_objectSpread({
156
187
  command: FileCommands.REMOVE.id,
157
188
  order: 'd'
158
- }, FileCommands.REMOVE));
189
+ }, FileCommands.REMOVE), {}, {
190
+ label: function label() {
191
+ return /*#__PURE__*/_jsx("div", {
192
+ children: l10n.t(FileCommands.REMOVE.label)
193
+ });
194
+ }
195
+ }));
159
196
  menu.registerMenuAction(FileTreeContextMenuGroups['change'], {
160
197
  id: FileCommands.RENAME.id,
161
198
  command: FileCommands.RENAME.id,
199
+ label: function label() {
200
+ return /*#__PURE__*/_jsx("div", {
201
+ children: l10n.t(FileCommands.RENAME.label)
202
+ });
203
+ },
162
204
  order: 'e'
163
205
  });
164
206
  menu.registerMenuAction(FileTreeContextMenuGroups['extra'], {
165
207
  id: FileCommands.COPY_PATH.id,
166
208
  command: FileCommands.COPY_PATH.id,
209
+ label: function label() {
210
+ return /*#__PURE__*/_jsx("div", {
211
+ children: l10n.t(FileCommands.COPY_PATH.label)
212
+ });
213
+ },
167
214
  order: 'f'
168
215
  });
169
216
  menu.registerMenuAction(FileTreeContextMenuGroups['extra'], {
170
217
  id: FileCommands.COPY_RELATIVE_PATH.id,
171
218
  command: FileCommands.COPY_RELATIVE_PATH.id,
219
+ label: function label() {
220
+ return /*#__PURE__*/_jsx("div", {
221
+ children: l10n.t(FileCommands.COPY_RELATIVE_PATH.label)
222
+ });
223
+ },
172
224
  order: 'g'
173
225
  });
174
226
  menu.registerMenuAction(FileTreeContextMenuGroups['extra'], {
175
227
  id: FileCommands.DOWNLOAD.id,
176
228
  command: FileCommands.DOWNLOAD.id,
229
+ label: function label() {
230
+ return /*#__PURE__*/_jsx("div", {
231
+ children: l10n.t(FileCommands.DOWNLOAD.label)
232
+ });
233
+ },
177
234
  order: 'h'
178
235
  });
179
236
  menu.registerMenuAction(FileTreeContextMenuGroups['extra'], {
180
237
  id: FileCommands.UPLOAD.id,
181
238
  command: FileCommands.UPLOAD.id,
239
+ label: function label() {
240
+ return /*#__PURE__*/_jsx("div", {
241
+ children: l10n.t(FileCommands.UPLOAD.label)
242
+ });
243
+ },
182
244
  order: 'i'
183
245
  });
184
246
  }
@@ -204,7 +266,7 @@ export var FileCommandContribution = (_dec = singleton({
204
266
  });
205
267
  }
206
268
  } catch (_unused) {
207
- message.error('文件打开失败');
269
+ message.error(l10n.t('文件打开失败'));
208
270
  }
209
271
  },
210
272
  isVisible: function isVisible(node) {
@@ -217,11 +279,13 @@ export var FileCommandContribution = (_dec = singleton({
217
279
  var filePath = node.uri.path.toString();
218
280
  Modal.confirm({
219
281
  width: 424,
220
- title: '确认要删除这个文件/文件夹吗?',
221
- content: "\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u6587\u4EF6 ".concat(filePath, " \uFF0C\u5220\u9664\u540E\u5C06\u4E0D\u53EF\u6062\u590D\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C\u3002"),
282
+ title: l10n.t('确认要删除这个文件/文件夹吗?'),
283
+ content: l10n.t('请确认是否删除文件 {filePath} ,删除后将不可恢复,请谨慎操作。', {
284
+ filePath: filePath
285
+ }),
222
286
  wrapClassName: 'libro-remove-file-modal',
223
- cancelText: '取消',
224
- okText: '确定',
287
+ cancelText: l10n.t('取消'),
288
+ okText: l10n.t('确定'),
225
289
  onOk: function () {
226
290
  var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
227
291
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -237,7 +301,7 @@ export var FileCommandContribution = (_dec = singleton({
237
301
  case 6:
238
302
  _context.prev = 6;
239
303
  _context.t0 = _context["catch"](0);
240
- message.error('删除文件失败!');
304
+ message.error(l10n.t('删除文件失败!'));
241
305
  case 9:
242
306
  _this2.fileView.model.refresh();
243
307
  case 10:
@@ -315,7 +379,7 @@ export var FileCommandContribution = (_dec = singleton({
315
379
  case 18:
316
380
  _context2.prev = 18;
317
381
  _context2.t0 = _context2["catch"](0);
318
- message.error('粘贴失败!');
382
+ message.error(l10n.t('粘贴失败!'));
319
383
  case 21:
320
384
  case "end":
321
385
  return _context2.stop();
@@ -545,7 +609,7 @@ export var FileCommandContribution = (_dec = singleton({
545
609
  id: FileCommands.REFRESH.id,
546
610
  command: FileCommands.REFRESH.id,
547
611
  icon: /*#__PURE__*/_jsx(ReloadOutlined, {}),
548
- tooltip: '刷新'
612
+ tooltip: l10n.t('刷新')
549
613
  });
550
614
  }
551
615
  }]);
@@ -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;AAOnE,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,CA4K5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,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;AAQnE,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,CA8K5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
@@ -11,6 +11,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { ThemeService } from '@difizen/mana-app';
12
12
  import { CommandRegistry } from '@difizen/mana-app';
13
13
  import { URI, useInject, ViewManager } from '@difizen/mana-app';
14
+ import { l10n } from '@difizen/mana-l10n';
14
15
  import { Col, Form, message, Row, Input, Modal, ConfigProvider, theme } from 'antd';
15
16
  import { useEffect, useRef, useState } from 'react';
16
17
  import "./index.less";
@@ -67,7 +68,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
67
68
  case 11:
68
69
  _context.prev = 11;
69
70
  _context.t0 = _context["catch"](3);
70
- message.error('新建文件失败');
71
+ message.error(l10n.t('新建文件失败'));
71
72
  case 14:
72
73
  case "end":
73
74
  return _context.stop();
@@ -88,7 +89,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
88
89
  _context2.next = 4;
89
90
  break;
90
91
  }
91
- throw new Error('请输入文件名');
92
+ throw new Error(l10n.t('请输入文件名'));
92
93
  case 4:
93
94
  targetURI = new URI((data === null || data === void 0 ? void 0 : data.path) + value + (fileType || ''));
94
95
  _context2.next = 7;
@@ -99,7 +100,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
99
100
  _context2.next = 10;
100
101
  break;
101
102
  }
102
- throw new Error('文件名称已存在,请重新输入');
103
+ throw new Error(l10n.t('文件名称已存在,请重新输入'));
103
104
  case 10:
104
105
  case "end":
105
106
  return _context2.stop();
@@ -125,12 +126,12 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
125
126
  algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
126
127
  },
127
128
  children: /*#__PURE__*/_jsxs(Modal, {
128
- title: "\u65B0\u5EFA\u6587\u4EF6",
129
+ title: l10n.t('新建文件'),
129
130
  open: visible,
130
131
  onCancel: close,
131
132
  width: 788,
132
- cancelText: "\u53D6\u6D88",
133
- okText: "\u786E\u5B9A",
133
+ cancelText: l10n.t('取消'),
134
+ okText: l10n.t('确定'),
134
135
  onOk: function onOk() {
135
136
  form.submit();
136
137
  },
@@ -140,14 +141,14 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
140
141
  className: "libro-create-file-path-container",
141
142
  children: [/*#__PURE__*/_jsx("div", {
142
143
  className: "libro-create-file-des",
143
- children: "\u521B\u5EFA\u4F4D\u7F6E\uFF1A"
144
+ children: l10n.t('创建位置:')
144
145
  }), /*#__PURE__*/_jsx("span", {
145
146
  className: "libro-create-file-path",
146
147
  children: data === null || data === void 0 ? void 0 : data.path
147
148
  })]
148
149
  }), /*#__PURE__*/_jsx("div", {
149
150
  className: "libro-create-file-des",
150
- children: "\u6587\u4EF6\u7C7B\u578B\uFF1A"
151
+ children: l10n.t('文件类型:')
151
152
  }), /*#__PURE__*/_jsxs(Row, {
152
153
  children: [/*#__PURE__*/_jsx(Col, {
153
154
  className: "gutter-row",
@@ -218,7 +219,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
218
219
  },
219
220
  children: [/*#__PURE__*/_jsx(MoreIcon, {}), /*#__PURE__*/_jsx("span", {
220
221
  className: "libro-create-file-type-text",
221
- children: "\u5176\u4ED6"
222
+ children: l10n.t('其他')
222
223
  })]
223
224
  })
224
225
  })]
@@ -230,7 +231,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
230
231
  className: "libro-create-file-form",
231
232
  children: /*#__PURE__*/_jsx(Form.Item, {
232
233
  name: "fileName",
233
- label: "\u6587\u4EF6\u540D\u79F0",
234
+ label: l10n.t('文件名称'),
234
235
  rules: [{
235
236
  required: true,
236
237
  validator: validateFileName
@@ -1 +1 @@
1
- {"version":3,"file":"file-createdir-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-createdir-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAWnE,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAChD,cAAc,CAAC,0BAA0B,CAAC,CA+F3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,0BAA0B,CAGpE,CAAC"}
1
+ {"version":3,"file":"file-createdir-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-createdir-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAYnE,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAChD,cAAc,CAAC,0BAA0B,CAAC,CA+F3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,0BAA0B,CAGpE,CAAC"}
@@ -12,6 +12,7 @@ import { ThemeService } from '@difizen/mana-app';
12
12
  import { URI } from '@difizen/mana-app';
13
13
  import { ViewManager } from '@difizen/mana-app';
14
14
  import { useInject } from '@difizen/mana-app';
15
+ import { l10n } from '@difizen/mana-l10n';
15
16
  import { Form, message, Input, Modal, ConfigProvider, theme } from 'antd';
16
17
  import { useEffect, useRef, useState } from 'react';
17
18
  import { JupyterFileService } from "./file-service.js";
@@ -55,7 +56,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
55
56
  case 9:
56
57
  _context.prev = 9;
57
58
  _context.t0 = _context["catch"](3);
58
- message.error('新建文件夹失败');
59
+ message.error(l10n.t('新建文件夹失败'));
59
60
  case 12:
60
61
  case "end":
61
62
  return _context.stop();
@@ -76,7 +77,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
76
77
  _context2.next = 4;
77
78
  break;
78
79
  }
79
- throw new Error('请输入文件夹名');
80
+ throw new Error(l10n.t('请输入文件夹名'));
80
81
  case 4:
81
82
  targetURI = new URI((data === null || data === void 0 ? void 0 : data.path) + value);
82
83
  _context2.next = 7;
@@ -87,7 +88,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
87
88
  _context2.next = 10;
88
89
  break;
89
90
  }
90
- throw new Error('文件夹名称已存在,请重新输入');
91
+ throw new Error(l10n.t('文件夹名称已存在,请重新输入'));
91
92
  case 10:
92
93
  case "end":
93
94
  return _context2.stop();
@@ -113,11 +114,11 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
113
114
  algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
114
115
  },
115
116
  children: /*#__PURE__*/_jsxs(Modal, {
116
- title: "\u65B0\u5EFA\u6587\u4EF6\u5939",
117
+ title: l10n.t('新建文件夹'),
117
118
  open: visible,
118
119
  onCancel: close,
119
- cancelText: "\u53D6\u6D88",
120
- okText: "\u786E\u5B9A",
120
+ cancelText: l10n.t('取消'),
121
+ okText: l10n.t('确定'),
121
122
  onOk: function onOk() {
122
123
  form.submit();
123
124
  },
@@ -126,7 +127,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
126
127
  width: 524,
127
128
  children: [/*#__PURE__*/_jsx("div", {
128
129
  className: "libro-create-file-des",
129
- children: "\u521B\u5EFA\u4F4D\u7F6E\uFF1A"
130
+ children: l10n.t('创建位置:')
130
131
  }), /*#__PURE__*/_jsx("span", {
131
132
  className: "libro-create-file-path",
132
133
  children: data === null || data === void 0 ? void 0 : data.path
@@ -138,7 +139,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
138
139
  className: "libro-create-dir-file-form",
139
140
  children: /*#__PURE__*/_jsx(Form.Item, {
140
141
  name: "dirName",
141
- label: "\u6587\u4EF6\u5939\u540D\u79F0",
142
+ label: l10n.t('文件夹名称'),
142
143
  rules: [{
143
144
  required: true,
144
145
  validator: validateDirName
@@ -1 +1 @@
1
- {"version":3,"file":"file-icon.d.ts","sourceRoot":"","sources":["../../src/file/file-icon.tsx"],"names":[],"mappings":"AAAA,UAAU,MAAM;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,2CA6BzC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,2CA6BpC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,2CA8DrC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,2CA8CvC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,2CAiUpC"}
1
+ {"version":3,"file":"file-icon.d.ts","sourceRoot":"","sources":["../../src/file/file-icon.tsx"],"names":[],"mappings":"AAAA,UAAU,MAAM;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,2CA6BzC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,2CA6BpC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,2CA8DrC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,2CA8CvC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,2CAgUpC"}
@@ -201,16 +201,14 @@ export function PythonIcon(props) {
201
201
  });
202
202
  }
203
203
  export function MoreIcon(prop) {
204
- return /*#__PURE__*/_jsxs("svg", {
204
+ return /*#__PURE__*/_jsx("svg", {
205
205
  width: "37px",
206
206
  height: "36px",
207
207
  viewBox: "0 0 37 36",
208
208
  version: "1.1",
209
209
  xmlns: "http://www.w3.org/2000/svg",
210
210
  xmlnsXlink: "http://www.w3.org/1999/xlink",
211
- children: [/*#__PURE__*/_jsx("title", {
212
- children: "\u5E93\u5B58\u67E5\u8BE2"
213
- }), /*#__PURE__*/_jsx("g", {
211
+ children: /*#__PURE__*/_jsx("g", {
214
212
  id: "\u6574\u4F53\u6846\u67B6\u90E8\u5206",
215
213
  stroke: "none",
216
214
  strokeWidth: "1",
@@ -470,6 +468,6 @@ export function MoreIcon(prop) {
470
468
  })
471
469
  })
472
470
  })
473
- })]
471
+ })
474
472
  });
475
473
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file-rename-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-rename-modal.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAOxE,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CA6F5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
1
+ {"version":3,"file":"file-rename-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-rename-modal.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxE,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CA6F5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
@@ -9,6 +9,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
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
11
  import { ThemeService, useInject, ViewManager } from '@difizen/mana-app';
12
+ import { l10n } from '@difizen/mana-l10n';
12
13
  import { Form, message, Input, Modal, theme, ConfigProvider } from 'antd';
13
14
  import { useEffect, useRef, useState } from 'react';
14
15
  import { JupyterFileService } from "./file-service.js";
@@ -66,7 +67,7 @@ export var FileRenameModalComponent = function FileRenameModalComponent(_ref) {
66
67
  case 10:
67
68
  _context.prev = 10;
68
69
  _context.t0 = _context["catch"](3);
69
- message.error('重命名文件/文件夹失败');
70
+ message.error(l10n.t('重命名文件/文件夹失败'));
70
71
  case 13:
71
72
  case "end":
72
73
  return _context.stop();
@@ -86,13 +87,13 @@ export var FileRenameModalComponent = function FileRenameModalComponent(_ref) {
86
87
  _context2.next = 4;
87
88
  break;
88
89
  }
89
- throw new Error('请输入文件夹名');
90
+ throw new Error(l10n.t('请输入文件夹名'));
90
91
  case 4:
91
92
  if (!(value === (data === null || data === void 0 ? void 0 : data.fileName))) {
92
93
  _context2.next = 6;
93
94
  break;
94
95
  }
95
- throw new Error('文件/文件夹名称已存在,请重新输入');
96
+ throw new Error(l10n.t('文件/文件夹名称已存在,请重新输入'));
96
97
  case 6:
97
98
  case "end":
98
99
  return _context2.stop();
@@ -108,7 +109,7 @@ export var FileRenameModalComponent = function FileRenameModalComponent(_ref) {
108
109
  algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
109
110
  },
110
111
  children: /*#__PURE__*/_jsx(Modal, {
111
- title: "\u6587\u4EF6\u91CD\u547D\u540D",
112
+ title: l10n.t('文件重命名'),
112
113
  open: visible,
113
114
  onCancel: close,
114
115
  onOk: function onOk() {
@@ -123,7 +124,7 @@ export var FileRenameModalComponent = function FileRenameModalComponent(_ref) {
123
124
  className: "libro-rename-file-form",
124
125
  children: /*#__PURE__*/_jsx(Form.Item, {
125
126
  name: "rename",
126
- label: "\u6587\u4EF6/\u6587\u4EF6\u5939\u540D\u79F0",
127
+ label: l10n.t('文件/文件夹名称'),
127
128
  rules: [{
128
129
  required: true,
129
130
  validator: validateRename
@@ -1 +1 @@
1
- {"version":3,"file":"file-service.d.ts","sourceRoot":"","sources":["../../src/file/file-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,K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,IAAI,CACjB,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,GAAG,EACZ,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,oBAAoB,CAAC;IAIjB,IAAI,CACjB,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,GAAG,EACZ,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,oBAAoB,CAAC;IAIhC,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,oBAAoB;IAUrC,OAAO,CACpB,QAAQ,EAAE,GAAG,EACb,QAAQ,CAAC,EAAE,kBAAkB,GAAG,SAAS,GACxC,OAAO,CAAC,oBAAoB,CAAC;IAkB1B,MAAM,CACV,QAAQ,EAAE,GAAG,EACb,QAAQ,CAAC,EAAE,kBAAkB,GAAG,SAAS,GACxC,OAAO,CAAC,oBAAoB,CAAC;IAK1B,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOrE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgBrE,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAa9E"}
@@ -25,6 +25,7 @@ import pathUtil from 'path';
25
25
  import { ContentsManager } from '@difizen/libro-kernel';
26
26
  import { Emitter } from '@difizen/mana-app';
27
27
  import { FileService, URI, inject, singleton } from '@difizen/mana-app';
28
+ import { l10n } from '@difizen/mana-l10n';
28
29
  import { message } from 'antd';
29
30
  import { FileNameAlias } from "./file-name-alias.js";
30
31
  export var JupyterFileService = (_dec = singleton({
@@ -375,7 +376,7 @@ export var JupyterFileService = (_dec = singleton({
375
376
  _context10.next = 6;
376
377
  break;
377
378
  }
378
- message.error('文件名重复');
379
+ message.error(l10n.t('文件名重复'));
379
380
  return _context10.abrupt("return", this.resolve(target));
380
381
  case 6:
381
382
  fileNameArr = fileName.split('.');
@@ -418,7 +419,7 @@ export var JupyterFileService = (_dec = singleton({
418
419
  _context11.next = 6;
419
420
  break;
420
421
  }
421
- message.error('文件夹重复');
422
+ message.error(l10n.t('文件夹重复'));
422
423
  return _context11.abrupt("return", this.resolve(target));
423
424
  case 6:
424
425
  _context11.next = 8;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file/file-view/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAGL,aAAa,EACb,YAAY,EAEZ,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EAEjB,eAAe,EAEf,aAAa,EACb,gBAAgB,EAIjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,cAAc,CAAC;AAUtB,qBAEa,QAAS,SAAQ,YAAY;IACjB,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC;IACnC,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;IAC5D,WAAW,CAAC,EAAE,gBAAgB,CAAC;IACtB,EAAE,SAAuB;IACzB,SAAS,SAA6B;gBAG1B,KAAK,EAAE,SAAS,EACZ,KAAK,EAAE,aAAa,EAChB,iBAAiB,EAAE,iBAAiB,EACrC,gBAAgB,EAAE,gBAAgB,EACrC,aAAa,EAAE,aAAa,EACrB,gBAAgB,EAAE,oBAAoB;IAe7D,WAAW,IAAI,IAAI;IAgB5B,YAAY,cAAe,MAAM,UAK/B;IACF;;OAEG;cACa,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OA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AAC,cAAc,CAAC;IAgC/E,cAAc,aAqBZ;IAEF,cAAc,aAIZ;IAEF,QAAQ,aAAoB,QAAQ,mBAqClC;IAEO,gBAAgB,CACvB,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GACnC,IAAI;CAeR"}
@@ -24,6 +24,7 @@ import { ExclamationCircleFilled, FolderFilled } from '@ant-design/icons';
24
24
  import { ContentsManager } from '@difizen/libro-kernel';
25
25
  import { FileTreeViewFactory } from '@difizen/mana-app';
26
26
  import { FileStatNode, FileTree, FileTreeModel, FileTreeView, isOSX, LabelProvider, TreeDecoratorService, TreeProps, TreeViewDecorator, TreeViewModule, CommandRegistry, ManaModule, OpenerService, SelectionService, view, inject, singleton } from '@difizen/mana-app';
27
+ import { l10n } from '@difizen/mana-l10n';
27
28
  import { Modal } from 'antd';
28
29
  import React from 'react';
29
30
  import "./index.less";
@@ -108,9 +109,9 @@ export var FileView = (_dec = singleton(), _dec2 = view(FileTreeViewFactory, Fil
108
109
  break;
109
110
  case 8:
110
111
  confirm({
111
- title: '文件大小警告',
112
+ title: l10n.t('文件大小警告'),
112
113
  icon: /*#__PURE__*/_jsx(ExclamationCircleFilled, {}),
113
- content: '您正尝试打开大于 10 MB 的文件,这可能会影响当前页面/服务的性能。',
114
+ content: l10n.t('您正尝试打开大于 10 MB 的文件,这可能会影响当前页面/服务的性能。'),
114
115
  onOk: function () {
115
116
  var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
116
117
  var opener;
@@ -150,7 +151,11 @@ export var FileView = (_dec = singleton(), _dec2 = view(FileTreeViewFactory, Fil
150
151
  return _ref.apply(this, arguments);
151
152
  };
152
153
  }();
153
- _this.title.label = '文件导航';
154
+ _this.title.label = function () {
155
+ return /*#__PURE__*/_jsx("div", {
156
+ children: l10n.t('文件导航')
157
+ });
158
+ };
154
159
  _this.title.icon = /*#__PURE__*/_jsx(FolderFilled, {});
155
160
  _this.toDispose.push(_this.model.onOpenNode(_this.openNode));
156
161
  return _this;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/file/utils.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,cAAc,WAAY,MAAM,SA8B5C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/file/utils.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,cAAc,WAAY,MAAM,SA8B5C,CAAC"}
package/es/file/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { l10n } from '@difizen/mana-l10n';
1
2
  import { message } from 'antd';
2
3
  function copyFallback(string) {
3
4
  function handler(event) {
@@ -9,9 +10,9 @@ function copyFallback(string) {
9
10
  document.addEventListener('copy', handler, true);
10
11
  var successful = document.execCommand('copy');
11
12
  if (successful) {
12
- message.success('复制成功');
13
+ message.success(l10n.t('复制成功'));
13
14
  } else {
14
- message.warning('复制失败');
15
+ message.warning(l10n.t('复制失败'));
15
16
  }
16
17
  }
17
18
 
@@ -23,10 +24,10 @@ export var copy2clipboard = function copy2clipboard(string) {
23
24
  if (result.state === 'granted' || result.state === 'prompt') {
24
25
  if (window.navigator && window.navigator.clipboard) {
25
26
  window.navigator.clipboard.writeText(string).then(function () {
26
- message.success('复制成功');
27
+ message.success(l10n.t('复制成功'));
27
28
  return;
28
29
  }).catch(function (err) {
29
- message.warning('复制失败');
30
+ message.warning(l10n.t('复制失败'));
30
31
  console.error('Could not copy text: ', err);
31
32
  });
32
33
  } else {