@difizen/libro-jupyter 0.1.10 → 0.1.12

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 (46) hide show
  1. package/es/add-between-cell/add-between-cell-command-contribution.js +2 -2
  2. package/es/cell/jupyter-code-cell-model.js +2 -2
  3. package/es/cell/jupyter-code-cell-view.js +2 -2
  4. package/es/command/command-contribution.js +2 -2
  5. package/es/command/keybinding-contribution.js +2 -2
  6. package/es/components/icons.js +3 -2
  7. package/es/config/config-contribution.js +2 -2
  8. package/es/contents/content-contribution.js +2 -2
  9. package/es/file/file-command.d.ts +46 -0
  10. package/es/file/file-command.d.ts.map +1 -1
  11. package/es/file/file-command.js +10 -9
  12. package/es/file/file-create-modal-contribution.js +2 -2
  13. package/es/file/file-create-modal.d.ts.map +1 -1
  14. package/es/file/file-create-modal.js +11 -2
  15. package/es/file/file-createdir-modal-contribution.js +2 -2
  16. package/es/file/file-createdir-modal.js +2 -2
  17. package/es/file/file-name-alias.js +2 -2
  18. package/es/file/file-rename-modal-contribution.js +2 -2
  19. package/es/file/file-rename-modal.js +2 -2
  20. package/es/file/file-service.d.ts +4 -1
  21. package/es/file/file-service.d.ts.map +1 -1
  22. package/es/file/file-service.js +9 -2
  23. package/es/file/file-tree-label-provider.js +2 -2
  24. package/es/file/file-view/index.d.ts.map +1 -1
  25. package/es/file/file-view/index.js +58 -14
  26. package/es/file/navigatable-view.js +2 -2
  27. package/es/file/open-handler-contribution.js +2 -2
  28. package/es/keybind-instructions/keybind-instructions-contribution.js +2 -2
  29. package/es/keybind-instructions/keybind-instructions-items.js +2 -2
  30. package/es/keybind-instructions/keybind-instructions-view.js +2 -2
  31. package/es/libro-jupyter-file-service.js +2 -2
  32. package/es/libro-jupyter-model.js +2 -2
  33. package/es/libro-jupyter-server-launch-manager.js +2 -2
  34. package/es/libro-jupyter-view.js +2 -2
  35. package/es/output/libro-jupyter-outputarea.js +2 -2
  36. package/es/rendermime/plotly-renderers.js +2 -2
  37. package/es/rendermime/plotly-rendermime-contribution.js +2 -2
  38. package/es/theme/color-registry.js +2 -2
  39. package/es/toolbar/save-file-error-contribution.js +2 -2
  40. package/es/toolbar/toolbar-contribution.js +2 -2
  41. package/package.json +16 -16
  42. package/src/components/icons.tsx +1 -1
  43. package/src/file/file-command.tsx +2 -1
  44. package/src/file/file-create-modal.tsx +6 -2
  45. package/src/file/file-service.ts +7 -0
  46. package/src/file/file-view/index.tsx +36 -7
@@ -6,8 +6,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
6
6
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
8
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
11
  import { CommandContribution, singleton } from '@difizen/mana-app';
12
12
  export var LibroAddBetweenCellCommand = {
13
13
  AddBetweenCell: {
@@ -6,8 +6,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
6
6
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
8
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
12
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
13
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -9,8 +9,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ 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); }
14
14
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
15
15
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
16
16
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -7,8 +7,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
14
  import { KernelCommands, LibroCommandRegister, LibroService, LibroToolbarArea, LibroView, NotebookCommands, LibroCellView, ExecutableCellView } from '@difizen/libro-core';
@@ -4,8 +4,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
4
4
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ 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); }
9
9
  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; }
10
10
  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.'); }
11
11
  import { NotebookCommands, DocumentCommands, LibroCommandRegister } from '@difizen/libro-core';
@@ -134,8 +134,9 @@ 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: "#7B7B7B",
138
- fillRule: "nonzero",
137
+ fill: "#7B7B7B"
138
+ // fillRule="nonzero"
139
+ ,
139
140
  children: /*#__PURE__*/_jsx("g", {
140
141
  id: "\u7F16\u7EC4-24",
141
142
  transform: "translate(637.000000, 80.000000)",
@@ -6,8 +6,8 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
6
6
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
8
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
11
  import { AutoInsertWhenNoCell, EnterEditModeWhenAddCell } from '@difizen/libro-core';
12
12
  import { ConfigurationContribution, ConfigurationService } from '@difizen/mana-app';
13
13
  import { ApplicationContribution } from '@difizen/mana-app';
@@ -6,8 +6,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
6
6
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
8
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
11
  import { ContentContribution } from '@difizen/libro-core';
12
12
  import { URI } from '@difizen/mana-app';
13
13
  import { singleton } from '@difizen/mana-app';
@@ -4,6 +4,52 @@ import { CommandContribution, FileStatNode, MenuContribution, ModalService, Open
4
4
  import { JupyterFileService } from './file-service.js';
5
5
  import { FileView } from './file-view/index.js';
6
6
  import './index.less';
7
+ export declare const FileCommands: {
8
+ OPEN_FILE: {
9
+ id: string;
10
+ label: string;
11
+ };
12
+ COPY: {
13
+ id: string;
14
+ label: string;
15
+ };
16
+ PASTE: {
17
+ id: string;
18
+ label: string;
19
+ };
20
+ CUT: {
21
+ id: string;
22
+ label: string;
23
+ };
24
+ RENAME: {
25
+ id: string;
26
+ label: string;
27
+ };
28
+ COPY_PATH: {
29
+ id: string;
30
+ label: string;
31
+ };
32
+ COPY_RELATIVE_PATH: {
33
+ id: string;
34
+ label: string;
35
+ };
36
+ CREATE_FILE: {
37
+ id: string;
38
+ label: string;
39
+ };
40
+ CREATE_DIR: {
41
+ id: string;
42
+ label: string;
43
+ };
44
+ REFRESH: {
45
+ id: string;
46
+ label: string;
47
+ };
48
+ REMOVE: {
49
+ id: string;
50
+ label: string;
51
+ };
52
+ };
7
53
  export declare const FileTreeContextMenuPath: MenuPath;
8
54
  export declare class FileCommandContribution implements CommandContribution, MenuContribution, ToolbarContribution {
9
55
  protected viewManager: ViewManager;
@@ -1 +1 @@
1
- {"version":3,"file":"file-command.d.ts","sourceRoot":"","sources":["../../src/file/file-command.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,YAAY,EAEZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EAEb,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,cAAc,CAAC;AAgDtB,eAAO,MAAM,uBAAuB,EAAE,QAAqC,CAAC;AAE5E,qBAGa,uBACX,YAAW,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB;IAErE,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACP,WAAW,EAAE,kBAAkB,CAAC;IACtC,YAAY,EAAE,YAAY,CAAC;IAC1B,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC;IAC5D,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,cAAc,EAAE,YAAY,CAAC;gBAEI,WAAW,EAAE,WAAW;IAazD,aAAa,CAAC,IAAI,EAAE,YAAY;IAoDhC,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAsKhD,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;CAQ7D"}
1
+ {"version":3,"file":"file-command.d.ts","sourceRoot":"","sources":["../../src/file/file-command.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,YAAY,EAEZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EAEb,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CxB,CAAC;AACF,eAAO,MAAM,uBAAuB,EAAE,QAAqC,CAAC;AAE5E,qBAGa,uBACX,YAAW,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB;IAErE,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACP,WAAW,EAAE,kBAAkB,CAAC;IACtC,YAAY,EAAE,YAAY,CAAC;IAC1B,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC;IAC5D,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,cAAc,EAAE,YAAY,CAAC;gBAEI,WAAW,EAAE,WAAW;IAazD,aAAa,CAAC,IAAI,EAAE,YAAY;IAoDhC,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAuKhD,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;CAQ7D"}
@@ -10,8 +10,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
+ 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); }
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 pathUtil from 'path';
@@ -27,7 +27,7 @@ import { FileView } from "./file-view/index.js";
27
27
  import { copy2clipboard } from "./utils.js";
28
28
  import "./index.less";
29
29
  import { jsx as _jsx } from "react/jsx-runtime";
30
- var FileCommands = {
30
+ export var FileCommands = {
31
31
  OPEN_FILE: {
32
32
  id: 'fileTree.command.openfile',
33
33
  label: '打开'
@@ -198,19 +198,20 @@ export var FileCommandContribution = (_dec = singleton({
198
198
  _context.next = 3;
199
199
  return _this2.fileService.delete(node.uri);
200
200
  case 3:
201
- _context.next = 8;
201
+ _this2.fileService.fileRemoveEmitter.fire(node.uri.path.toString());
202
+ _context.next = 9;
202
203
  break;
203
- case 5:
204
- _context.prev = 5;
204
+ case 6:
205
+ _context.prev = 6;
205
206
  _context.t0 = _context["catch"](0);
206
207
  message.error('删除文件失败!');
207
- case 8:
208
- _this2.fileView.model.refresh();
209
208
  case 9:
209
+ _this2.fileView.model.refresh();
210
+ case 10:
210
211
  case "end":
211
212
  return _context.stop();
212
213
  }
213
- }, _callee, null, [[0, 5]]);
214
+ }, _callee, null, [[0, 6]]);
214
215
  }));
215
216
  function onOk() {
216
217
  return _onOk.apply(this, arguments);
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { ModalContribution, singleton } from '@difizen/mana-app';
9
9
  import { FileCreateModal } from "./file-create-modal.js";
10
10
  export var FileCreateModalContribution = (_dec = singleton({
@@ -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;AAKnE,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,CAmJ5E,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;AAKnE,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,CAuJ5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
@@ -44,7 +44,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
44
44
  close();
45
45
  _context.prev = 3;
46
46
  _context.next = 6;
47
- return fileService.newFile(values.fileName + fileType || '', new URI(data.path));
47
+ return fileService.newFile(values.fileName + (fileType || ''), new URI(data.path));
48
48
  case 6:
49
49
  if (fileView) {
50
50
  fileView.model.refresh();
@@ -141,7 +141,9 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
141
141
  children: /*#__PURE__*/_jsxs("div", {
142
142
  className: "libro-create-file-type ".concat(fileType === '.ipynb' ? 'active' : ''),
143
143
  onClick: function onClick() {
144
+ var _inputRef$current2;
144
145
  setFileType('.ipynb');
146
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.focus();
145
147
  },
146
148
  children: [/*#__PURE__*/_jsx(NotebookIcon, {}), /*#__PURE__*/_jsx("span", {
147
149
  className: "libro-create-file-type-text",
@@ -157,7 +159,9 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
157
159
  children: /*#__PURE__*/_jsxs("div", {
158
160
  className: "libro-create-file-type ".concat(fileType === '.py' ? 'active' : ''),
159
161
  onClick: function onClick() {
162
+ var _inputRef$current3;
160
163
  setFileType('.py');
164
+ (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || _inputRef$current3.focus();
161
165
  },
162
166
  children: [/*#__PURE__*/_jsx(PythonIcon, {}), /*#__PURE__*/_jsx("span", {
163
167
  className: "libro-create-file-type-text",
@@ -173,7 +177,9 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
173
177
  children: /*#__PURE__*/_jsxs("div", {
174
178
  className: "libro-create-file-type ".concat(fileType === '.json' ? 'active' : ''),
175
179
  onClick: function onClick() {
180
+ var _inputRef$current4;
176
181
  setFileType('.json');
182
+ (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 || _inputRef$current4.focus();
177
183
  },
178
184
  children: [/*#__PURE__*/_jsx(JSONIcon, {}), /*#__PURE__*/_jsx("span", {
179
185
  className: "libro-create-file-type-text",
@@ -189,7 +195,9 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
189
195
  children: /*#__PURE__*/_jsxs("div", {
190
196
  className: "libro-create-file-type ".concat(fileType === undefined ? 'active' : ''),
191
197
  onClick: function onClick() {
198
+ var _inputRef$current5;
192
199
  setFileType(undefined);
200
+ (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 || _inputRef$current5.focus();
193
201
  },
194
202
  children: [/*#__PURE__*/_jsx(MoreIcon, {}), /*#__PURE__*/_jsx("span", {
195
203
  className: "libro-create-file-type-text",
@@ -211,7 +219,8 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
211
219
  validator: validateFileName
212
220
  }],
213
221
  children: /*#__PURE__*/_jsx(Input, {
214
- addonAfter: fileType || ''
222
+ addonAfter: fileType || '',
223
+ ref: inputRef
215
224
  })
216
225
  })
217
226
  })]
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { ModalContribution, singleton } from '@difizen/mana-app';
9
9
  import { FileDirCreateModal } from "./file-createdir-modal.js";
10
10
  export var FileCreateDirModalContribution = (_dec = singleton({
@@ -139,7 +139,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
139
139
  }],
140
140
  children: /*#__PURE__*/_jsx(Input, {
141
141
  ref: inputRef,
142
- onKeyDown: /*#__PURE__*/function () {
142
+ onKeyDown: ( /*#__PURE__*/function () {
143
143
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
144
144
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
145
145
  while (1) switch (_context3.prev = _context3.next) {
@@ -156,7 +156,7 @@ export var FileCreateDirModalComponent = function FileCreateDirModalComponent(_r
156
156
  return function (_x5) {
157
157
  return _ref4.apply(this, arguments);
158
158
  };
159
- }()
159
+ }())
160
160
  })
161
161
  })
162
162
  })]
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { singleton } from '@difizen/mana-app';
9
9
  export var FileNameAlias = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
10
10
  function FileNameAlias() {
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { ModalContribution, singleton } from '@difizen/mana-app';
9
9
  import { FileRenameModal } from "./file-rename-modal.js";
10
10
  export var FileRenameModalContribution = (_dec = singleton({
@@ -121,7 +121,7 @@ export var FileRenameModalComponent = function FileRenameModalComponent(_ref) {
121
121
  initialValue: data.fileName,
122
122
  children: /*#__PURE__*/_jsx(Input, {
123
123
  ref: inputRef,
124
- onKeyDown: /*#__PURE__*/function () {
124
+ onKeyDown: ( /*#__PURE__*/function () {
125
125
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
126
126
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
127
127
  while (1) switch (_context3.prev = _context3.next) {
@@ -138,7 +138,7 @@ export var FileRenameModalComponent = function FileRenameModalComponent(_ref) {
138
138
  return function (_x5) {
139
139
  return _ref4.apply(this, arguments);
140
140
  };
141
- }()
141
+ }())
142
142
  })
143
143
  })
144
144
  })
@@ -1,6 +1,7 @@
1
1
  import type { IContentsModel } from '@difizen/libro-kernel';
2
2
  import { ContentsManager } from '@difizen/libro-kernel';
3
- import type { CopyFileOptions, FileStatWithMetadata, MoveFileOptions, ResolveFileOptions } from '@difizen/mana-app';
3
+ import type { CopyFileOptions, FileStatWithMetadata, MoveFileOptions, ResolveFileOptions, Event as ManaEvent } from '@difizen/mana-app';
4
+ import { Emitter } from '@difizen/mana-app';
4
5
  import { FileService, URI } from '@difizen/mana-app';
5
6
  import { FileNameAlias } from './file-name-alias.js';
6
7
  import type { DirItem } from './file-protocol.js';
@@ -13,6 +14,8 @@ interface DirectoryModel extends IContentsModel {
13
14
  content: IContentsModel[];
14
15
  }
15
16
  export declare class JupyterFileService extends FileService {
17
+ fileRemoveEmitter: Emitter<string>;
18
+ get onFileRemove(): ManaEvent<string>;
16
19
  protected readonly contentsManager: ContentsManager;
17
20
  protected fileNameAlias: FileNameAlias;
18
21
  constructor(fileNameAlias: FileNameAlias);
@@ -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,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,GAAG,EAAqB,MAAM,mBAAmB,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,UAAU,QAAS,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,UAAU,cAAe,SAAQ,cAAc;IAC7C,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,qBACa,kBAAmB,SAAQ,WAAW;IACxB,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAe7E,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;gBAIrC,aAAa,EAAE,aAAa;IAOxB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IASrE,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAY5C,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cASzC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAW1E,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,KAAK,IAAI,cAAc;IAOrE,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ;IAuBtC,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"}
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,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,KAAK,IAAI,SAAS,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,GAAG,EAAqB,MAAM,mBAAmB,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,UAAU,QAAS,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,UAAU,cAAe,SAAQ,cAAc;IAC7C,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,qBACa,kBAAmB,SAAQ,WAAW;IACjD,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAyB;IAE3D,IAAI,YAAY,IAAI,SAAS,CAAC,MAAM,CAAC,CAEpC;IACwB,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAe7E,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;gBAIrC,aAAa,EAAE,aAAa;IAOxB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IASrE,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAY5C,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cASzC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAW1E,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,KAAK,IAAI,cAAc;IAOrE,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ;IAuBtC,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"}
@@ -10,8 +10,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
+ 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); }
15
15
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
16
16
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -23,6 +23,7 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
23
23
  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.'); }
24
24
  import pathUtil from 'path';
25
25
  import { ContentsManager } from '@difizen/libro-kernel';
26
+ import { Emitter } from '@difizen/mana-app';
26
27
  import { FileService, URI, inject, singleton } from '@difizen/mana-app';
27
28
  import { message } from 'antd';
28
29
  import { FileNameAlias } from "./file-name-alias.js";
@@ -35,6 +36,7 @@ export var JupyterFileService = (_dec = singleton({
35
36
  var _this;
36
37
  _classCallCheck(this, JupyterFileService);
37
38
  _this = _super.call(this);
39
+ _this.fileRemoveEmitter = new Emitter();
38
40
  _initializerDefineProperty(_this, "contentsManager", _descriptor, _assertThisInitialized(_this));
39
41
  // '/read'
40
42
  // '/read-dir'
@@ -55,6 +57,11 @@ export var JupyterFileService = (_dec = singleton({
55
57
  }
56
58
  JupyterFileService = inject(FileNameAlias)(JupyterFileService, undefined, 0) || JupyterFileService;
57
59
  _createClass(JupyterFileService, [{
60
+ key: "onFileRemove",
61
+ get: function get() {
62
+ return this.fileRemoveEmitter.event;
63
+ }
64
+ }, {
58
65
  key: "write",
59
66
  value: function () {
60
67
  var _write = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(filePath, content) {
@@ -4,8 +4,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
4
4
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ 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); }
9
9
  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; }
10
10
  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.'); }
11
11
  import { FileStatNode, LabelProvider, LabelProviderContribution, TreeLabelProvider, URIIconReference, inject, singleton } from '@difizen/mana-app';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file/file-view/index.tsx"],"names":[],"mappings":"AACA,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;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,cAAc,CAAC;AAMtB,qBAEa,QAAS,SAAQ,YAAY;IACjB,SAAS,CAAC,WAAW,EAAE,aAAa,CAAC;IACnC,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;IACnD,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;IAetE,QAAQ,aAAoB,QAAQ,mBAWlC;IAEO,gBAAgB,CACvB,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GACnC,IAAI;CAeR"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file/file-view/index.tsx"],"names":[],"mappings":"AACA,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,OAAO,EAAE,eAAe,CAAC;IACnD,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;IAetE,QAAQ,aAAoB,QAAQ,mBAmClC;IAEO,gBAAgB,CACvB,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GACnC,IAAI;CAeR"}
@@ -7,8 +7,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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 _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
13
13
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
14
14
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -20,13 +20,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
20
20
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
21
  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; }
22
22
  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.'); }
23
- import { FolderFilled } from '@ant-design/icons';
23
+ import { ExclamationCircleFilled, FolderFilled } from '@ant-design/icons';
24
24
  import { FileTreeViewFactory } from '@difizen/mana-app';
25
25
  import { FileStatNode, FileTree, FileTreeModel, FileTreeView, isOSX, LabelProvider, TreeDecoratorService, TreeProps, TreeViewDecorator, TreeViewModule, CommandRegistry, ManaModule, OpenerService, SelectionService, view, inject, singleton } from '@difizen/mana-app';
26
+ import { Modal } from 'antd';
26
27
  import React from 'react';
27
28
  import "./index.less";
28
29
  import { jsx as _jsx } from "react/jsx-runtime";
29
30
  var FileTreeModule = ManaModule.create().register(FileTree, FileTreeModel).dependOn(TreeViewModule);
31
+ var confirm = Modal.confirm;
32
+ var noVerifyFileType = ['.ipynb', '.py'];
30
33
  export var FileView = (_dec = singleton(), _dec2 = view(FileTreeViewFactory, FileTreeModule), _dec3 = inject(OpenerService), _dec4 = inject(CommandRegistry), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_FileTreeView) {
31
34
  _inherits(FileView, _FileTreeView);
32
35
  var _super = _createSuper(FileView);
@@ -39,31 +42,72 @@ export var FileView = (_dec = singleton(), _dec2 = view(FileTreeViewFactory, Fil
39
42
  _this.id = FileTreeViewFactory;
40
43
  _this.className = 'libro-jupyter-file-tree';
41
44
  _this.openNode = /*#__PURE__*/function () {
42
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(treeNode) {
45
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(treeNode) {
43
46
  var opener;
44
- return _regeneratorRuntime().wrap(function _callee$(_context) {
45
- while (1) switch (_context.prev = _context.next) {
47
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
48
+ while (1) switch (_context2.prev = _context2.next) {
46
49
  case 0:
47
50
  if (!(FileStatNode.is(treeNode) && !treeNode.fileStat.isDirectory)) {
48
- _context.next = 5;
51
+ _context2.next = 9;
49
52
  break;
50
53
  }
51
- _context.next = 3;
54
+ if (!((treeNode.fileStat.size || 0) / (1024 * 1024) < 10 || noVerifyFileType.includes(treeNode.fileStat.resource.path.ext))) {
55
+ _context2.next = 8;
56
+ break;
57
+ }
58
+ _context2.next = 4;
52
59
  return _this.openService.getOpener(treeNode.uri);
53
- case 3:
54
- opener = _context.sent;
60
+ case 4:
61
+ opener = _context2.sent;
55
62
  if (opener) {
56
63
  opener.open(treeNode.uri, {
57
64
  viewOptions: {
58
- name: treeNode.fileStat.name
65
+ name: treeNode.fileStat.name,
66
+ fileSize: treeNode.fileStat.size
59
67
  }
60
68
  });
61
69
  }
62
- case 5:
70
+ _context2.next = 9;
71
+ break;
72
+ case 8:
73
+ confirm({
74
+ title: '文件大小警告',
75
+ icon: /*#__PURE__*/_jsx(ExclamationCircleFilled, {}),
76
+ content: '您正尝试打开大于 10 MB 的文件,这可能会影响当前页面/服务的性能。',
77
+ onOk: function () {
78
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
79
+ var opener;
80
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
81
+ while (1) switch (_context.prev = _context.next) {
82
+ case 0:
83
+ _context.next = 2;
84
+ return _this.openService.getOpener(treeNode.uri);
85
+ case 2:
86
+ opener = _context.sent;
87
+ if (opener) {
88
+ opener.open(treeNode.uri, {
89
+ viewOptions: {
90
+ name: treeNode.fileStat.name
91
+ }
92
+ });
93
+ }
94
+ case 4:
95
+ case "end":
96
+ return _context.stop();
97
+ }
98
+ }, _callee);
99
+ }));
100
+ function onOk() {
101
+ return _onOk.apply(this, arguments);
102
+ }
103
+ return onOk;
104
+ }()
105
+ });
106
+ case 9:
63
107
  case "end":
64
- return _context.stop();
108
+ return _context2.stop();
65
109
  }
66
- }, _callee);
110
+ }, _callee2);
67
111
  }));
68
112
  return function (_x) {
69
113
  return _ref.apply(this, arguments);
@@ -7,8 +7,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
13
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -13,8 +13,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
13
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
14
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
15
15
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
17
+ 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); }
18
18
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
19
19
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
20
20
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -7,8 +7,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
14
  import { LibroCommandRegister, LibroToolbarArea, LibroView } from '@difizen/libro-core';
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  var _dec, _class;
3
3
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  import { singleton } from '@difizen/mana-app';
9
9
  import { l10n } from '@difizen/mana-l10n';
@@ -10,8 +10,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
+ 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); }
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 { LirboContextKey } from '@difizen/libro-core';
@@ -5,8 +5,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
5
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
6
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
7
7
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ 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); }
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -7,8 +7,8 @@ function _initializerDefineProperty(target, property, descriptor, context) { if
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
13
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -6,8 +6,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
6
6
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
8
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
11
  import { ServerManager, ServerConnection } from '@difizen/libro-kernel';
12
12
  import { inject, singleton } from '@difizen/mana-app';
13
13
  import { ApplicationContribution } from '@difizen/mana-app';
@@ -3,8 +3,8 @@ var _dec, _dec2, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
9
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -9,8 +9,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ 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); }
14
14
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
15
15
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
16
16
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
@@ -9,8 +9,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ 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); }
14
14
  /**
15
15
  * The options used to create a renderer.
16
16
  */
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  var _dec, _class;
3
3
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
  import { RenderMimeContribution } from '@difizen/libro-rendermime';
9
9
  import { singleton } from '@difizen/mana-app';
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { Color, ColorContribution } from '@difizen/mana-app';
9
9
  import { singleton } from '@difizen/mana-app';
10
10
  export var LibroJupyterColorContribution = (_dec = singleton({
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { ModalContribution, singleton } from '@difizen/mana-app';
9
9
  import { SaveFileErrorModal } from "./save-file-error.js";
10
10
  export var SaveFileErrorContribution = (_dec = singleton({
@@ -3,8 +3,8 @@ var _dec, _class;
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
5
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
8
  import { KernelCommands, NotebookCommands } from '@difizen/libro-core';
9
9
  import { singleton, inject, ToolbarContribution } from '@difizen/mana-app';
10
10
  import { l10n } from '@difizen/mana-l10n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-jupyter",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro"
@@ -31,21 +31,21 @@
31
31
  "src"
32
32
  ],
33
33
  "dependencies": {
34
- "@difizen/libro-cofine-editor": "^0.1.10",
35
- "@difizen/libro-code-editor": "^0.1.10",
36
- "@difizen/libro-code-cell": "^0.1.10",
37
- "@difizen/libro-codemirror": "^0.1.10",
38
- "@difizen/libro-rendermime": "^0.1.10",
39
- "@difizen/libro-common": "^0.1.10",
40
- "@difizen/libro-core": "^0.1.10",
41
- "@difizen/libro-kernel": "^0.1.10",
42
- "@difizen/libro-l10n": "^0.1.10",
43
- "@difizen/libro-output": "^0.1.10",
44
- "@difizen/libro-search": "^0.1.10",
45
- "@difizen/libro-search-code-cell": "^0.1.10",
46
- "@difizen/libro-lsp": "^0.1.10",
47
- "@difizen/libro-markdown-cell": "^0.1.10",
48
- "@difizen/libro-raw-cell": "^0.1.10",
34
+ "@difizen/libro-cofine-editor": "^0.1.12",
35
+ "@difizen/libro-code-editor": "^0.1.12",
36
+ "@difizen/libro-code-cell": "^0.1.12",
37
+ "@difizen/libro-codemirror": "^0.1.12",
38
+ "@difizen/libro-rendermime": "^0.1.12",
39
+ "@difizen/libro-common": "^0.1.12",
40
+ "@difizen/libro-core": "^0.1.12",
41
+ "@difizen/libro-kernel": "^0.1.12",
42
+ "@difizen/libro-l10n": "^0.1.12",
43
+ "@difizen/libro-output": "^0.1.12",
44
+ "@difizen/libro-search": "^0.1.12",
45
+ "@difizen/libro-search-code-cell": "^0.1.12",
46
+ "@difizen/libro-lsp": "^0.1.12",
47
+ "@difizen/libro-markdown-cell": "^0.1.12",
48
+ "@difizen/libro-raw-cell": "^0.1.12",
49
49
  "@difizen/mana-app": "latest",
50
50
  "@difizen/mana-l10n": "latest",
51
51
  "@ant-design/colors": "^7.0.0",
@@ -101,7 +101,7 @@ export const Location: React.FC = () => (
101
101
  id="2.0-kernel-启动前"
102
102
  transform="translate(-738.000000, -80.000000)"
103
103
  fill="#7B7B7B"
104
- fillRule="nonzero"
104
+ // fillRule="nonzero"
105
105
  >
106
106
  <g id="编组-24" transform="translate(637.000000, 80.000000)">
107
107
  <g id="location" transform="translate(99.000000, 0.000000)">
@@ -29,7 +29,7 @@ import { FileView } from './file-view/index.js';
29
29
  import { copy2clipboard } from './utils.js';
30
30
  import './index.less';
31
31
 
32
- const FileCommands = {
32
+ export const FileCommands = {
33
33
  OPEN_FILE: {
34
34
  id: 'fileTree.command.openfile',
35
35
  label: '打开',
@@ -199,6 +199,7 @@ export class FileCommandContribution
199
199
  onOk: async () => {
200
200
  try {
201
201
  await this.fileService.delete(node.uri);
202
+ this.fileService.fileRemoveEmitter.fire(node.uri.path.toString());
202
203
  } catch {
203
204
  message.error('删除文件失败!');
204
205
  }
@@ -37,7 +37,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
37
37
  await form.validateFields();
38
38
  close();
39
39
  try {
40
- await fileService.newFile(values.fileName + fileType || '', new URI(data.path));
40
+ await fileService.newFile(values.fileName + (fileType || ''), new URI(data.path));
41
41
  if (fileView) {
42
42
  fileView.model.refresh();
43
43
  }
@@ -100,6 +100,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
100
100
  }`}
101
101
  onClick={() => {
102
102
  setFileType('.ipynb');
103
+ inputRef.current?.focus();
103
104
  }}
104
105
  >
105
106
  <NotebookIcon />
@@ -114,6 +115,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
114
115
  className={`libro-create-file-type ${fileType === '.py' ? 'active' : ''}`}
115
116
  onClick={() => {
116
117
  setFileType('.py');
118
+ inputRef.current?.focus();
117
119
  }}
118
120
  >
119
121
  <PythonIcon />
@@ -128,6 +130,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
128
130
  className={`libro-create-file-type ${fileType === '.json' ? 'active' : ''}`}
129
131
  onClick={() => {
130
132
  setFileType('.json');
133
+ inputRef.current?.focus();
131
134
  }}
132
135
  >
133
136
  <JSONIcon />
@@ -144,6 +147,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
144
147
  }`}
145
148
  onClick={() => {
146
149
  setFileType(undefined);
150
+ inputRef.current?.focus();
147
151
  }}
148
152
  >
149
153
  <MoreIcon />
@@ -163,7 +167,7 @@ export const FileCreateModalComponent: React.FC<ModalItemProps<ModalItemType>> =
163
167
  label="文件名称"
164
168
  rules={[{ required: true, validator: validateFileName }]}
165
169
  >
166
- <Input addonAfter={fileType || ''} />
170
+ <Input addonAfter={fileType || ''} ref={inputRef} />
167
171
  </Form.Item>
168
172
  </Form>
169
173
  </Modal>
@@ -7,7 +7,9 @@ import type {
7
7
  FileStatWithMetadata,
8
8
  MoveFileOptions,
9
9
  ResolveFileOptions,
10
+ Event as ManaEvent,
10
11
  } from '@difizen/mana-app';
12
+ import { Emitter } from '@difizen/mana-app';
11
13
  import { FileService, URI, inject, singleton } from '@difizen/mana-app';
12
14
  import { message } from 'antd';
13
15
 
@@ -26,6 +28,11 @@ interface DirectoryModel extends IContentsModel {
26
28
 
27
29
  @singleton({ token: FileService })
28
30
  export class JupyterFileService extends FileService {
31
+ fileRemoveEmitter: Emitter<string> = new Emitter<string>();
32
+
33
+ get onFileRemove(): ManaEvent<string> {
34
+ return this.fileRemoveEmitter.event;
35
+ }
29
36
  @inject(ContentsManager) protected readonly contentsManager: ContentsManager;
30
37
  // '/read'
31
38
  // '/read-dir'
@@ -1,4 +1,4 @@
1
- import { FolderFilled } from '@ant-design/icons';
1
+ import { ExclamationCircleFilled, FolderFilled } from '@ant-design/icons';
2
2
  import type { TreeNode, ViewOpenHandler } from '@difizen/mana-app';
3
3
  import { FileTreeViewFactory } from '@difizen/mana-app';
4
4
  import {
@@ -20,6 +20,7 @@ import {
20
20
  inject,
21
21
  singleton,
22
22
  } from '@difizen/mana-app';
23
+ import { Modal } from 'antd';
23
24
  import React from 'react';
24
25
 
25
26
  import type { LibroNavigatableView } from '../navigatable-view.js';
@@ -30,6 +31,10 @@ const FileTreeModule = ManaModule.create()
30
31
  .register(FileTree, FileTreeModel)
31
32
  .dependOn(TreeViewModule);
32
33
 
34
+ const { confirm } = Modal;
35
+
36
+ const noVerifyFileType = ['.ipynb', '.py'];
37
+
33
38
  @singleton()
34
39
  @view(FileTreeViewFactory, FileTreeModule)
35
40
  export class FileView extends FileTreeView {
@@ -61,12 +66,36 @@ export class FileView extends FileTreeView {
61
66
 
62
67
  openNode = async (treeNode: TreeNode) => {
63
68
  if (FileStatNode.is(treeNode) && !treeNode.fileStat.isDirectory) {
64
- const opener = (await this.openService.getOpener(
65
- treeNode.uri,
66
- )) as ViewOpenHandler<LibroNavigatableView>;
67
- if (opener) {
68
- opener.open(treeNode.uri, {
69
- viewOptions: { name: treeNode.fileStat.name },
69
+ if (
70
+ (treeNode.fileStat.size || 0) / (1024 * 1024) < 10 ||
71
+ noVerifyFileType.includes(treeNode.fileStat.resource.path.ext)
72
+ ) {
73
+ const opener = (await this.openService.getOpener(
74
+ treeNode.uri,
75
+ )) as ViewOpenHandler<LibroNavigatableView>;
76
+ if (opener) {
77
+ opener.open(treeNode.uri, {
78
+ viewOptions: {
79
+ name: treeNode.fileStat.name,
80
+ fileSize: treeNode.fileStat.size,
81
+ },
82
+ });
83
+ }
84
+ } else {
85
+ confirm({
86
+ title: '文件大小警告',
87
+ icon: <ExclamationCircleFilled />,
88
+ content: '您正尝试打开大于 10 MB 的文件,这可能会影响当前页面/服务的性能。',
89
+ onOk: async () => {
90
+ const opener = (await this.openService.getOpener(
91
+ treeNode.uri,
92
+ )) as ViewOpenHandler<LibroNavigatableView>;
93
+ if (opener) {
94
+ opener.open(treeNode.uri, {
95
+ viewOptions: { name: treeNode.fileStat.name },
96
+ });
97
+ }
98
+ },
70
99
  });
71
100
  }
72
101
  }