@difizen/libro-jupyter 0.2.0 → 0.2.1

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 (146) hide show
  1. package/es/add-between-cell/add-between-cell.js +1 -1
  2. package/es/cell/jupyter-code-cell-view.d.ts +3 -1
  3. package/es/cell/jupyter-code-cell-view.d.ts.map +1 -1
  4. package/es/cell/jupyter-code-cell-view.js +12 -5
  5. package/es/command/command-contribution.d.ts.map +1 -1
  6. package/es/command/command-contribution.js +5 -5
  7. package/es/components/icons.js +1 -1
  8. package/es/contents/content-contribution.js +1 -1
  9. package/es/contents/save-content-contribution.d.ts +10 -0
  10. package/es/contents/save-content-contribution.d.ts.map +1 -0
  11. package/es/contents/save-content-contribution.js +110 -0
  12. package/es/file/file-create-modal.d.ts.map +1 -1
  13. package/es/file/file-create-modal.js +16 -5
  14. package/es/file/file-service.js +1 -1
  15. package/es/file/index.d.ts +1 -0
  16. package/es/file/index.d.ts.map +1 -1
  17. package/es/file/index.js +2 -1
  18. package/es/index.d.ts +1 -0
  19. package/es/index.d.ts.map +1 -1
  20. package/es/index.js +2 -1
  21. package/es/keybind-instructions/index.less +9 -9
  22. package/es/keybind-instructions/keybind-instructions-view.d.ts +2 -2
  23. package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -1
  24. package/es/keybind-instructions/keybind-instructions-view.js +69 -63
  25. package/es/libro-jupyter-model.d.ts +2 -4
  26. package/es/libro-jupyter-model.d.ts.map +1 -1
  27. package/es/libro-jupyter-model.js +35 -120
  28. package/es/libro-jupyter-workspace.d.ts +18 -0
  29. package/es/libro-jupyter-workspace.d.ts.map +1 -0
  30. package/es/libro-jupyter-workspace.js +108 -0
  31. package/es/module.d.ts.map +1 -1
  32. package/es/module.js +5 -2
  33. package/es/output/libro-jupyter-outputarea.d.ts.map +1 -1
  34. package/es/output/libro-jupyter-outputarea.js +60 -56
  35. package/es/toolbar/save-file-error.d.ts.map +1 -1
  36. package/es/toolbar/save-file-error.js +20 -13
  37. package/es/widget/box/contribution.d.ts +10 -0
  38. package/es/widget/box/contribution.d.ts.map +1 -0
  39. package/es/widget/box/contribution.js +48 -0
  40. package/es/widget/box/index.d.ts +3 -0
  41. package/es/widget/box/index.d.ts.map +1 -0
  42. package/es/widget/box/index.js +2 -0
  43. package/es/widget/box/index.less +3 -0
  44. package/es/widget/box/view.d.ts +19 -0
  45. package/es/widget/box/view.d.ts.map +1 -0
  46. package/es/widget/box/view.js +114 -0
  47. package/es/widget/comm.d.ts +65 -0
  48. package/es/widget/comm.d.ts.map +1 -0
  49. package/es/widget/comm.js +153 -0
  50. package/es/widget/index.d.ts +10 -0
  51. package/es/widget/index.d.ts.map +1 -0
  52. package/es/widget/index.js +9 -0
  53. package/es/widget/index.less +7 -0
  54. package/es/widget/instance-progress/contribution.d.ts +10 -0
  55. package/es/widget/instance-progress/contribution.d.ts.map +1 -0
  56. package/es/widget/instance-progress/contribution.js +39 -0
  57. package/es/widget/instance-progress/index.d.ts +3 -0
  58. package/es/widget/instance-progress/index.d.ts.map +1 -0
  59. package/es/widget/instance-progress/index.js +2 -0
  60. package/es/widget/instance-progress/view.d.ts +30 -0
  61. package/es/widget/instance-progress/view.d.ts.map +1 -0
  62. package/es/widget/instance-progress/view.js +180 -0
  63. package/es/widget/libro-widgets.d.ts +84 -0
  64. package/es/widget/libro-widgets.d.ts.map +1 -0
  65. package/es/widget/libro-widgets.js +307 -0
  66. package/es/widget/module.d.ts +4 -0
  67. package/es/widget/module.d.ts.map +1 -0
  68. package/es/widget/module.js +38 -0
  69. package/es/widget/progress/contribution.d.ts +10 -0
  70. package/es/widget/progress/contribution.d.ts.map +1 -0
  71. package/es/widget/progress/contribution.js +39 -0
  72. package/es/widget/progress/index.d.ts +3 -0
  73. package/es/widget/progress/index.d.ts.map +1 -0
  74. package/es/widget/progress/index.js +2 -0
  75. package/es/widget/progress/progressBar.d.ts +15 -0
  76. package/es/widget/progress/progressBar.d.ts.map +1 -0
  77. package/es/widget/progress/progressBar.js +20 -0
  78. package/es/widget/progress/view.d.ts +19 -0
  79. package/es/widget/progress/view.d.ts.map +1 -0
  80. package/es/widget/progress/view.js +74 -0
  81. package/es/widget/protocol.d.ts +193 -0
  82. package/es/widget/protocol.d.ts.map +1 -0
  83. package/es/widget/protocol.js +33 -0
  84. package/es/widget/utils.d.ts +27 -0
  85. package/es/widget/utils.d.ts.map +1 -0
  86. package/es/widget/utils.js +59 -0
  87. package/es/widget/version.d.ts +3 -0
  88. package/es/widget/version.d.ts.map +1 -0
  89. package/es/widget/version.js +2 -0
  90. package/es/widget/widget-manager.d.ts +19 -0
  91. package/es/widget/widget-manager.d.ts.map +1 -0
  92. package/es/widget/widget-manager.js +77 -0
  93. package/es/widget/widget-render.d.ts +7 -0
  94. package/es/widget/widget-render.d.ts.map +1 -0
  95. package/es/widget/widget-render.js +46 -0
  96. package/es/widget/widget-rendermime-contribution.d.ts +16 -0
  97. package/es/widget/widget-rendermime-contribution.d.ts.map +1 -0
  98. package/es/widget/widget-rendermime-contribution.js +50 -0
  99. package/es/widget/widget-view-contribution.d.ts +10 -0
  100. package/es/widget/widget-view-contribution.d.ts.map +1 -0
  101. package/es/widget/widget-view-contribution.js +36 -0
  102. package/es/widget/widget-view.d.ts +71 -0
  103. package/es/widget/widget-view.d.ts.map +1 -0
  104. package/es/widget/widget-view.js +273 -0
  105. package/package.json +18 -18
  106. package/src/add-between-cell/add-between-cell.tsx +1 -1
  107. package/src/cell/jupyter-code-cell-view.tsx +14 -6
  108. package/src/command/command-contribution.ts +11 -10
  109. package/src/components/icons.tsx +1 -1
  110. package/src/contents/content-contribution.ts +1 -1
  111. package/src/contents/save-content-contribution.ts +67 -0
  112. package/src/file/file-create-modal.tsx +10 -1
  113. package/src/file/file-service.ts +1 -1
  114. package/src/file/index.ts +1 -0
  115. package/src/index.ts +1 -0
  116. package/src/keybind-instructions/index.less +9 -9
  117. package/src/keybind-instructions/keybind-instructions-view.tsx +72 -62
  118. package/src/libro-jupyter-model.ts +1 -69
  119. package/src/libro-jupyter-workspace.ts +49 -0
  120. package/src/module.ts +6 -0
  121. package/src/output/libro-jupyter-outputarea.tsx +56 -49
  122. package/src/toolbar/save-file-error.tsx +25 -15
  123. package/src/widget/box/contribution.ts +29 -0
  124. package/src/widget/box/index.less +3 -0
  125. package/src/widget/box/index.ts +2 -0
  126. package/src/widget/box/view.tsx +112 -0
  127. package/src/widget/comm.ts +152 -0
  128. package/src/widget/index.less +7 -0
  129. package/src/widget/index.ts +9 -0
  130. package/src/widget/instance-progress/contribution.ts +20 -0
  131. package/src/widget/instance-progress/index.ts +2 -0
  132. package/src/widget/instance-progress/view.tsx +155 -0
  133. package/src/widget/libro-widgets.ts +223 -0
  134. package/src/widget/module.ts +73 -0
  135. package/src/widget/progress/contribution.ts +24 -0
  136. package/src/widget/progress/index.ts +2 -0
  137. package/src/widget/progress/progressBar.tsx +29 -0
  138. package/src/widget/progress/view.tsx +70 -0
  139. package/src/widget/protocol.ts +255 -0
  140. package/src/widget/utils.ts +67 -0
  141. package/src/widget/version.ts +2 -0
  142. package/src/widget/widget-manager.ts +45 -0
  143. package/src/widget/widget-render.tsx +52 -0
  144. package/src/widget/widget-rendermime-contribution.ts +36 -0
  145. package/src/widget/widget-view-contribution.ts +14 -0
  146. package/src/widget/widget-view.tsx +259 -0
@@ -14,11 +14,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
14
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
- import { LirboContextKey } from '@difizen/libro-core';
18
- import { inject, singleton } from '@difizen/mana-app';
17
+ import { LibroContextKey } from '@difizen/libro-core';
18
+ import { inject, singleton, ThemeService } from '@difizen/mana-app';
19
19
  import { getOrigin, prop, useInject } from '@difizen/mana-app';
20
20
  import { l10n } from '@difizen/mana-l10n';
21
- import { Input, Drawer, Table, Segmented } from 'antd';
21
+ import { Input, Drawer, Table, Segmented, ConfigProvider, theme } from 'antd';
22
22
  import { forwardRef, useCallback, useState } from 'react';
23
23
  import { LibroKeybindItems } from "./keybind-instructions-items.js";
24
24
  import "./index.less";
@@ -47,7 +47,7 @@ var getSearchResult = function getSearchResult(value, sourceData, targetData) {
47
47
  }
48
48
  });
49
49
  };
50
- export var KeybindInstrutionsService = (_dec = singleton(), _dec2 = inject(LirboContextKey), _dec3 = prop(), _dec4 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
50
+ export var KeybindInstrutionsService = (_dec = singleton(), _dec2 = inject(LibroContextKey), _dec3 = prop(), _dec4 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
51
51
  function KeybindInstrutionsService() {
52
52
  _classCallCheck(this, KeybindInstrutionsService);
53
53
  _initializerDefineProperty(this, "contextKey", _descriptor, this);
@@ -137,6 +137,7 @@ export var KeybindInstrutionsComponent = /*#__PURE__*/forwardRef(function Keybin
137
137
  segment = _useState2[0],
138
138
  setSegment = _useState2[1];
139
139
  var keybindInstrutionsService = useInject(KeybindInstrutionsService);
140
+ var themeService = useInject(ThemeService);
140
141
  var libroKeybindItems = useInject(LibroKeybindItems);
141
142
  var handleClose = useCallback(function () {
142
143
  close();
@@ -151,70 +152,75 @@ export var KeybindInstrutionsComponent = /*#__PURE__*/forwardRef(function Keybin
151
152
  };
152
153
  var commandModeDataSource = getOrigin(keybindInstrutionsService.searchCommandModeData.length > 0 ? keybindInstrutionsService.searchCommandModeData : libroKeybindItems.commandModeData);
153
154
  var editModeDataSource = getOrigin(keybindInstrutionsService.searchEditModeData.length > 0 ? keybindInstrutionsService.searchEditModeData : libroKeybindItems.editModeData);
154
- return /*#__PURE__*/_jsx("div", {
155
- className: "libro-keybind-instructions-command",
156
- ref: ref,
157
- children: /*#__PURE__*/_jsxs(Drawer, {
158
- title: /*#__PURE__*/_jsx(Segmented, {
159
- value: segment,
160
- onChange: function onChange(value) {
161
- return setSegment(value);
162
- },
163
- options: [{
164
- label: l10n.t('快捷键'),
165
- value: 'keybind'
166
- }, {
167
- label: 'Magic 命令',
168
- value: 'magic'
169
- }]
170
- }),
171
- placement: "right",
172
- onClose: handleClose,
173
- width: "360px",
174
- open: visible,
175
- mask: true,
176
- className: "libro-keybind-instructions-drawer",
177
- maskClosable: true,
178
- children: [segment === 'magic' && /*#__PURE__*/_jsx("div", {
179
- className: "libro-magic-table",
180
- children: /*#__PURE__*/_jsx(Table, {
181
- size: "small",
182
- columns: magicColumns,
183
- dataSource: magics,
184
- pagination: false,
185
- rowKey: "key"
186
- })
187
- }), segment === 'keybind' && /*#__PURE__*/_jsxs(_Fragment, {
188
- children: [/*#__PURE__*/_jsx("div", {
189
- className: "libro-keybind-instructions-command-search",
190
- children: /*#__PURE__*/_jsx(Search, {
191
- placeholder: l10n.t('搜索功能关键字'),
192
- allowClear: true,
193
- bordered: false,
194
- size: "middle",
195
- onSearch: handleSearch
155
+ return /*#__PURE__*/_jsx(ConfigProvider, {
156
+ theme: {
157
+ algorithm: themeService.getCurrentTheme().type === 'dark' ? theme.darkAlgorithm : theme.defaultAlgorithm
158
+ },
159
+ children: /*#__PURE__*/_jsx("div", {
160
+ className: "libro-keybind-instructions-command",
161
+ ref: ref,
162
+ children: /*#__PURE__*/_jsxs(Drawer, {
163
+ title: /*#__PURE__*/_jsx(Segmented, {
164
+ value: segment,
165
+ onChange: function onChange(value) {
166
+ return setSegment(value);
167
+ },
168
+ options: [{
169
+ label: l10n.t('快捷键'),
170
+ value: 'keybind'
171
+ }, {
172
+ label: 'Magic 命令',
173
+ value: 'magic'
174
+ }]
175
+ }),
176
+ placement: "right",
177
+ onClose: handleClose,
178
+ width: "360px",
179
+ open: visible,
180
+ mask: true,
181
+ className: "libro-keybind-instructions-drawer",
182
+ maskClosable: true,
183
+ children: [segment === 'magic' && /*#__PURE__*/_jsx("div", {
184
+ className: "libro-magic-table",
185
+ children: /*#__PURE__*/_jsx(Table, {
186
+ size: "small",
187
+ columns: magicColumns,
188
+ dataSource: magics,
189
+ pagination: false,
190
+ rowKey: "key"
196
191
  })
197
- }), /*#__PURE__*/_jsxs("div", {
198
- className: "libro-keybind-instructions-table",
192
+ }), segment === 'keybind' && /*#__PURE__*/_jsxs(_Fragment, {
199
193
  children: [/*#__PURE__*/_jsx("div", {
200
- className: "libro-command-mode-keybind-instructions-table",
201
- children: /*#__PURE__*/_jsx(Table, {
202
- rowKey: "key",
203
- columns: libroKeybindItems.commandModeActionColumns,
204
- dataSource: commandModeDataSource,
205
- pagination: false
206
- })
207
- }), /*#__PURE__*/_jsx("div", {
208
- className: "libro-edit-mode-keybind-instructions-table",
209
- children: /*#__PURE__*/_jsx(Table, {
210
- rowKey: "key",
211
- columns: libroKeybindItems.editModeActionColumns,
212
- dataSource: editModeDataSource,
213
- pagination: false
194
+ className: "libro-keybind-instructions-command-search",
195
+ children: /*#__PURE__*/_jsx(Search, {
196
+ placeholder: l10n.t('搜索功能关键字'),
197
+ allowClear: true,
198
+ bordered: false,
199
+ size: "middle",
200
+ onSearch: handleSearch
214
201
  })
202
+ }), /*#__PURE__*/_jsxs("div", {
203
+ className: "libro-keybind-instructions-table",
204
+ children: [/*#__PURE__*/_jsx("div", {
205
+ className: "libro-command-mode-keybind-instructions-table",
206
+ children: /*#__PURE__*/_jsx(Table, {
207
+ rowKey: "key",
208
+ columns: libroKeybindItems.commandModeActionColumns,
209
+ dataSource: commandModeDataSource,
210
+ pagination: false
211
+ })
212
+ }), /*#__PURE__*/_jsx("div", {
213
+ className: "libro-edit-mode-keybind-instructions-table",
214
+ children: /*#__PURE__*/_jsx(Table, {
215
+ rowKey: "key",
216
+ columns: libroKeybindItems.editModeActionColumns,
217
+ dataSource: editModeDataSource,
218
+ pagination: false
219
+ })
220
+ })]
215
221
  })]
216
222
  })]
217
- })]
223
+ })
218
224
  })
219
225
  });
220
226
  });
@@ -1,14 +1,13 @@
1
1
  import type { VirtualizedManager } from '@difizen/libro-core';
2
2
  import { LibroModel, VirtualizedManagerHelper } from '@difizen/libro-core';
3
- import { ContentsManager, ExecutableNotebookModel, LibroKernelConnectionManager, ServerConnection, ServerManager } from '@difizen/libro-kernel';
4
- import type { IKernelConnection } from '@difizen/libro-kernel';
3
+ import { ContentsManager, LibroKernelConnectionManager, ServerConnection, ServerManager } from '@difizen/libro-kernel';
4
+ import type { IKernelConnection, ExecutableNotebookModel } from '@difizen/libro-kernel';
5
5
  import type { IContentsCheckpointModel, IContentsModel } from '@difizen/libro-kernel';
6
6
  import { ModalService } from '@difizen/mana-app';
7
7
  import { Deferred } from '@difizen/mana-app';
8
8
  import { LibroFileService } from './libro-jupyter-protocol.js';
9
9
  type IModel = IContentsModel;
10
10
  export declare class LibroJupyterModel extends LibroModel implements ExecutableNotebookModel {
11
- static is: (arg: Record<any, any> | undefined) => arg is LibroJupyterModel;
12
11
  protected libroFileService: LibroFileService;
13
12
  protected virtualizedManager: VirtualizedManager;
14
13
  get fileService(): LibroFileService;
@@ -41,7 +40,6 @@ export declare class LibroJupyterModel extends LibroModel implements ExecutableN
41
40
  restoreCheckpoint(checkpointID: string): Promise<void>;
42
41
  deleteCheckpoint(checkpointID: string): Promise<void>;
43
42
  startKernelConnection(): void;
44
- saveNotebookContent(): Promise<void>;
45
43
  canRun(): boolean;
46
44
  interrupt(): Promise<void>;
47
45
  shutdown(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"libro-jupyter-model.d.ts","sourceRoot":"","sources":["../src/libro-jupyter-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,uBAAuB,EAEvB,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAa,YAAY,EAAQ,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAAO,EAGL,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAIrC,KAAK,MAAM,GAAG,cAAc,CAAC;AAC7B,qBACa,iBAAkB,SAAQ,UAAW,YAAW,uBAAuB;IAClF,MAAM,CAAC,EAAE,QAAS,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,8BAS5C;IAEF,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAEjD,IAAI,WAAW,qBAEd;IAGD,mBAAmB,EAAE,MAAM,CAAC;IAE5B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAE/B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAE/B,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IAGrC,UAAU,UAAQ;IAElB,SAAS,CAAC,uBAAuB,EAAE,4BAA4B,CAAC;IAChE,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IACpD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAGlB,gBAAgB,EAAE,gBAAgB,EAE5D,uBAAuB,EAAE,4BAA4B,EAC9B,aAAa,EAAE,aAAa,EACzB,gBAAgB,EAAE,gBAAgB,EACnC,eAAe,EAAE,eAAe,EACnC,YAAY,EAAE,YAAY,EAEhD,wBAAwB,EAAE,wBAAwB;IA6BpD,IAAI,YAAY,wBAEf;IAED,IAAI,eAAe,IAIQ,MAAM,CAFhC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAEhC;IAED,IAAI,mBAAmB,IAIQ,MAAM,CAFpC;IAED,IAAI,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAEpC;IACD,SAAS,CAAC,UAAU,8BAAqC;IACzD,IAAI,OAAO,+BAEV;IAGD,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAC;IAGtC,QAAQ,SAAM;IAEd,SAAS,CAAC,aAAa,SAAM;IAE7B,IAAI,YAAY,IAIQ,MAAM,CAF7B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,qBAAqB,EAAE,wBAAwB,CAAC;IAE1C,gBAAgB;IAMhB,eAAe;IAIf,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAItC,gBAAgB,CAAC,YAAY,EAAE,MAAM;IAI3C,qBAAqB;IA2BN,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAuD1C,MAAM;IAcT,SAAS;IAQT,QAAQ;IAUR,OAAO;IAkBP,SAAS;IAQf,eAAe;CAYhB"}
1
+ {"version":3,"file":"libro-jupyter-model.d.ts","sourceRoot":"","sources":["../src/libro-jupyter-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EAEf,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAa,YAAY,EAAQ,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAAO,EAGL,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAGrC,KAAK,MAAM,GAAG,cAAc,CAAC;AAC7B,qBACa,iBAAkB,SAAQ,UAAW,YAAW,uBAAuB;IAClF,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAEjD,IAAI,WAAW,qBAEd;IAGD,mBAAmB,EAAE,MAAM,CAAC;IAE5B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAE/B,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;IAE/B,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IAGrC,UAAU,UAAQ;IAElB,SAAS,CAAC,uBAAuB,EAAE,4BAA4B,CAAC;IAChE,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IACpD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAGlB,gBAAgB,EAAE,gBAAgB,EAE5D,uBAAuB,EAAE,4BAA4B,EAC9B,aAAa,EAAE,aAAa,EACzB,gBAAgB,EAAE,gBAAgB,EACnC,eAAe,EAAE,eAAe,EACnC,YAAY,EAAE,YAAY,EAEhD,wBAAwB,EAAE,wBAAwB;IA6BpD,IAAI,YAAY,wBAEf;IAED,IAAI,eAAe,IAIQ,MAAM,CAFhC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAEhC;IAED,IAAI,mBAAmB,IAIQ,MAAM,CAFpC;IAED,IAAI,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAEpC;IACD,SAAS,CAAC,UAAU,8BAAqC;IACzD,IAAI,OAAO,+BAEV;IAGD,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAC;IAGtC,QAAQ,SAAM;IAEd,SAAS,CAAC,aAAa,SAAM;IAE7B,IAAI,YAAY,IAIQ,MAAM,CAF7B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,qBAAqB,EAAE,wBAAwB,CAAC;IAE1C,gBAAgB;IAMhB,eAAe;IAIf,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAItC,gBAAgB,CAAC,YAAY,EAAE,MAAM;IAI3C,qBAAqB;IA2BZ,MAAM;IAcT,SAAS;IAQT,QAAQ;IAUR,OAAO;IAkBP,SAAS;IAQf,eAAe;CAYhB"}
@@ -1,5 +1,5 @@
1
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _LibroJupyterModel;
2
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
3
3
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
4
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
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); }); }; }
@@ -22,15 +22,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
22
22
  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; }
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 { LibroModel, VirtualizedManagerHelper } from '@difizen/libro-core';
25
- import { ContentsManager, ExecutableNotebookModel, isDisplayDataMsg, LibroKernelConnectionManager, ServerConnection, ServerManager } from '@difizen/libro-kernel';
25
+ import { ContentsManager, isDisplayDataMsg, LibroKernelConnectionManager, ServerConnection, ServerManager } from '@difizen/libro-kernel';
26
26
  import { getOrigin, ModalService, prop } from '@difizen/mana-app';
27
27
  import { Deferred } from '@difizen/mana-app';
28
28
  import { inject, transient } from '@difizen/mana-app';
29
29
  import { l10n } from '@difizen/mana-l10n';
30
30
  import { ExecutedWithKernelCellModel, libroArgsMimetype, LibroFileService } from "./libro-jupyter-protocol.js";
31
- import { SaveFileErrorModal } from "./toolbar/save-file-error.js";
32
31
  import { getDefaultKernel } from "./utils/index.js";
33
- export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop(), _dec4 = prop(), _dec5 = prop(), _dec6 = prop(), _dec7 = prop(), _dec8 = prop(), _dec(_class = (_class2 = (_LibroJupyterModel = /*#__PURE__*/function (_LibroModel) {
32
+ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop(), _dec4 = prop(), _dec5 = prop(), _dec6 = prop(), _dec7 = prop(), _dec8 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function (_LibroModel) {
34
33
  _inherits(LibroJupyterModel, _LibroModel);
35
34
  var _super = _createSuper(LibroJupyterModel);
36
35
  function LibroJupyterModel(libroFileService, kernelConnectionManager, serverManager, serverConnection, contentsManager, modalService, virtualizedManagerHelper) {
@@ -250,88 +249,6 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
250
249
  }, _callee5);
251
250
  }))).catch(console.error);
252
251
  }
253
- }, {
254
- key: "saveNotebookContent",
255
- value: function () {
256
- var _saveNotebookContent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
257
- var notebookContent, res, _res, errorMsg;
258
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
259
- while (1) switch (_context6.prev = _context6.next) {
260
- case 0:
261
- notebookContent = this.toJSON();
262
- if (this.currentFileContents) {
263
- _context6.next = 3;
264
- break;
265
- }
266
- throw new Error('currentFileContents is undefined');
267
- case 3:
268
- res = {};
269
- _context6.prev = 4;
270
- _context6.next = 7;
271
- return this.libroFileService.write(notebookContent, this.currentFileContents);
272
- case 7:
273
- res = _context6.sent;
274
- if (res) {
275
- _context6.next = 10;
276
- break;
277
- }
278
- return _context6.abrupt("return");
279
- case 10:
280
- if (!(res.last_modified === this.last_modified || res.size === 0)) {
281
- _context6.next = 15;
282
- break;
283
- }
284
- errorMsg = "File Save Error: ".concat((_res = res) === null || _res === void 0 ? void 0 : _res.message, " ");
285
- this.libroFileService.fileSaveErrorEmitter.fire({
286
- cause: res.message,
287
- msg: errorMsg,
288
- name: res.name,
289
- path: res.path,
290
- created: res.created,
291
- last_modified: res.last_modified,
292
- size: res.size,
293
- type: res.type
294
- });
295
- this.modalService.openModal(SaveFileErrorModal);
296
- throw new Error(errorMsg);
297
- case 15:
298
- _context6.next = 24;
299
- break;
300
- case 17:
301
- _context6.prev = 17;
302
- _context6.t0 = _context6["catch"](4);
303
- if (res) {
304
- _context6.next = 21;
305
- break;
306
- }
307
- return _context6.abrupt("return");
308
- case 21:
309
- this.libroFileService.fileSaveErrorEmitter.fire({
310
- cause: _context6.t0.errorCause,
311
- msg: _context6.t0.message,
312
- name: res.name || this.currentFileContents.name,
313
- path: res.path || this.currentFileContents.path,
314
- created: res.created || this.currentFileContents.created,
315
- last_modified: res.last_modified || this.currentFileContents.last_modified,
316
- size: res.size || this.currentFileContents.size,
317
- type: res.type || this.currentFileContents.type
318
- });
319
- this.modalService.openModal(SaveFileErrorModal);
320
- throw new Error('File Save Error');
321
- case 24:
322
- _context6.next = 26;
323
- return this.createCheckpoint();
324
- case 26:
325
- case "end":
326
- return _context6.stop();
327
- }
328
- }, _callee6, this, [[4, 17]]);
329
- }));
330
- function saveNotebookContent() {
331
- return _saveNotebookContent.apply(this, arguments);
332
- }
333
- return saveNotebookContent;
334
- }()
335
252
  }, {
336
253
  key: "canRun",
337
254
  value: function canRun() {
@@ -348,24 +265,24 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
348
265
  }, {
349
266
  key: "interrupt",
350
267
  value: function () {
351
- var _interrupt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
352
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
353
- while (1) switch (_context7.prev = _context7.next) {
268
+ var _interrupt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
269
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
270
+ while (1) switch (_context6.prev = _context6.next) {
354
271
  case 0:
355
272
  if (this.kernelConnection) {
356
- _context7.next = 3;
273
+ _context6.next = 3;
357
274
  break;
358
275
  }
359
276
  alert(l10n.t('Kernel Connection 还没有建立'));
360
- return _context7.abrupt("return");
277
+ return _context6.abrupt("return");
361
278
  case 3:
362
- _context7.next = 5;
279
+ _context6.next = 5;
363
280
  return this.kernelConnection.interrupt();
364
281
  case 5:
365
282
  case "end":
366
- return _context7.stop();
283
+ return _context6.stop();
367
284
  }
368
- }, _callee7, this);
285
+ }, _callee6, this);
369
286
  }));
370
287
  function interrupt() {
371
288
  return _interrupt.apply(this, arguments);
@@ -375,26 +292,26 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
375
292
  }, {
376
293
  key: "shutdown",
377
294
  value: function () {
378
- var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
379
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
380
- while (1) switch (_context8.prev = _context8.next) {
295
+ var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
296
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
297
+ while (1) switch (_context7.prev = _context7.next) {
381
298
  case 0:
382
299
  if (this.kernelConnection) {
383
- _context8.next = 3;
300
+ _context7.next = 3;
384
301
  break;
385
302
  }
386
303
  alert(l10n.t('Kernel Connection 还没有建立'));
387
- return _context8.abrupt("return");
304
+ return _context7.abrupt("return");
388
305
  case 3:
389
- _context8.next = 5;
306
+ _context7.next = 5;
390
307
  return this.kernelConnectionManager.shutdownKC(this.currentFileContents);
391
308
  case 5:
392
309
  this.kernelConnection = undefined;
393
310
  case 6:
394
311
  case "end":
395
- return _context8.stop();
312
+ return _context7.stop();
396
313
  }
397
- }, _callee8, this);
314
+ }, _callee7, this);
398
315
  }));
399
316
  function shutdown() {
400
317
  return _shutdown.apply(this, arguments);
@@ -404,13 +321,13 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
404
321
  }, {
405
322
  key: "restart",
406
323
  value: function () {
407
- var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
324
+ var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
408
325
  var _this3 = this;
409
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
410
- while (1) switch (_context9.prev = _context9.next) {
326
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
327
+ while (1) switch (_context8.prev = _context8.next) {
411
328
  case 0:
412
329
  if (!(!this.kernelConnection || this.kernelConnection.isDisposed)) {
413
- _context9.next = 4;
330
+ _context8.next = 4;
414
331
  break;
415
332
  }
416
333
  this.startKernelConnection();
@@ -421,14 +338,14 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
421
338
  }
422
339
  return;
423
340
  }).catch(console.error);
424
- return _context9.abrupt("return");
341
+ return _context8.abrupt("return");
425
342
  case 4:
426
343
  this.kernelConnection.restart();
427
344
  case 5:
428
345
  case "end":
429
- return _context9.stop();
346
+ return _context8.stop();
430
347
  }
431
- }, _callee9, this);
348
+ }, _callee8, this);
432
349
  }));
433
350
  function restart() {
434
351
  return _restart.apply(this, arguments);
@@ -438,24 +355,24 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
438
355
  }, {
439
356
  key: "reconnect",
440
357
  value: function () {
441
- var _reconnect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
442
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
443
- while (1) switch (_context10.prev = _context10.next) {
358
+ var _reconnect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
359
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
360
+ while (1) switch (_context9.prev = _context9.next) {
444
361
  case 0:
445
362
  if (this.kernelConnection) {
446
- _context10.next = 3;
363
+ _context9.next = 3;
447
364
  break;
448
365
  }
449
366
  alert(l10n.t('Kernel Connection 还没有建立'));
450
- return _context10.abrupt("return");
367
+ return _context9.abrupt("return");
451
368
  case 3:
452
- _context10.next = 5;
369
+ _context9.next = 5;
453
370
  return this.kernelConnection.reconnect();
454
371
  case 5:
455
372
  case "end":
456
- return _context10.stop();
373
+ return _context9.stop();
457
374
  }
458
- }, _callee10, this);
375
+ }, _callee9, this);
459
376
  }));
460
377
  function reconnect() {
461
378
  return _reconnect.apply(this, arguments);
@@ -478,9 +395,7 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
478
395
  }
479
396
  }]);
480
397
  return LibroJupyterModel;
481
- }(LibroModel), _LibroJupyterModel.is = function (arg) {
482
- return !!arg && ExecutableNotebookModel.is(arg) && 'kernelConnection' in arg && _typeof(arg.kernelConnection) === 'object' && 'lspEnabled' in arg && typeof arg.lspEnabled === 'boolean';
483
- }, _LibroJupyterModel), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "currentFileContents", [_dec2], {
398
+ }(LibroModel), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "currentFileContents", [_dec2], {
484
399
  configurable: true,
485
400
  enumerable: true,
486
401
  writable: true,
@@ -0,0 +1,18 @@
1
+ import { BaseWorkspaceService, ILibroWorkspaceService } from '@difizen/libro-core';
2
+ import { ServerConnection, ServerManager } from '@difizen/libro-kernel';
3
+ import { ApplicationContribution } from '@difizen/mana-app';
4
+ import { URI } from '@difizen/mana-app';
5
+ interface JupyterWorkspaceData {
6
+ rootUri: string;
7
+ }
8
+ export declare class JupyterWorkspaceService extends BaseWorkspaceService implements ILibroWorkspaceService, ApplicationContribution {
9
+ serverConnection: ServerConnection;
10
+ serverManager: ServerManager;
11
+ protected workspaceData: JupyterWorkspaceData;
12
+ onViewStart(): void;
13
+ get workspaceRoot(): URI;
14
+ get notebooks(): never[];
15
+ get files(): never[];
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=libro-jupyter-workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-jupyter-workspace.d.ts","sourceRoot":"","sources":["../src/libro-jupyter-workspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBACa,uBACX,SAAQ,oBACR,YAAW,sBAAsB,EAAE,uBAAuB;IAEhC,gBAAgB,EAAE,gBAAgB,CAAC;IACtC,aAAa,EAAE,aAAa,CAAC;IAEpD,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAE9C,WAAW;IAkBX,IAAa,aAAa,QAEzB;IACD,IAAa,SAAS,YAErB;IACD,IAAa,KAAK,YAEjB;CACF"}