@theia/notebook 1.41.0

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 (188) hide show
  1. package/README.md +30 -0
  2. package/lib/browser/contributions/notebook-actions-contribution.d.ts +27 -0
  3. package/lib/browser/contributions/notebook-actions-contribution.d.ts.map +1 -0
  4. package/lib/browser/contributions/notebook-actions-contribution.js +172 -0
  5. package/lib/browser/contributions/notebook-actions-contribution.js.map +1 -0
  6. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts +30 -0
  7. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts.map +1 -0
  8. package/lib/browser/contributions/notebook-cell-actions-contribution.js +200 -0
  9. package/lib/browser/contributions/notebook-cell-actions-contribution.js.map +1 -0
  10. package/lib/browser/contributions/notebook-color-contribution.d.ts +6 -0
  11. package/lib/browser/contributions/notebook-color-contribution.d.ts.map +1 -0
  12. package/lib/browser/contributions/notebook-color-contribution.js +252 -0
  13. package/lib/browser/contributions/notebook-color-contribution.js.map +1 -0
  14. package/lib/browser/contributions/notebook-context-keys.d.ts +38 -0
  15. package/lib/browser/contributions/notebook-context-keys.d.ts.map +1 -0
  16. package/lib/browser/contributions/notebook-context-keys.js +95 -0
  17. package/lib/browser/contributions/notebook-context-keys.js.map +1 -0
  18. package/lib/browser/index.d.ts +11 -0
  19. package/lib/browser/index.d.ts.map +1 -0
  20. package/lib/browser/index.js +38 -0
  21. package/lib/browser/index.js.map +1 -0
  22. package/lib/browser/notebook-cell-resource-resolver.d.ts +20 -0
  23. package/lib/browser/notebook-cell-resource-resolver.d.ts.map +1 -0
  24. package/lib/browser/notebook-cell-resource-resolver.js +75 -0
  25. package/lib/browser/notebook-cell-resource-resolver.js.map +1 -0
  26. package/lib/browser/notebook-editor-widget-factory.d.ts +17 -0
  27. package/lib/browser/notebook-editor-widget-factory.d.ts.map +1 -0
  28. package/lib/browser/notebook-editor-widget-factory.js +78 -0
  29. package/lib/browser/notebook-editor-widget-factory.js.map +1 -0
  30. package/lib/browser/notebook-editor-widget.d.ts +49 -0
  31. package/lib/browser/notebook-editor-widget.d.ts.map +1 -0
  32. package/lib/browser/notebook-editor-widget.js +150 -0
  33. package/lib/browser/notebook-editor-widget.js.map +1 -0
  34. package/lib/browser/notebook-frontend-module.d.ts +5 -0
  35. package/lib/browser/notebook-frontend-module.d.ts.map +1 -0
  36. package/lib/browser/notebook-frontend-module.js +81 -0
  37. package/lib/browser/notebook-frontend-module.js.map +1 -0
  38. package/lib/browser/notebook-open-handler.d.ts +18 -0
  39. package/lib/browser/notebook-open-handler.d.ts.map +1 -0
  40. package/lib/browser/notebook-open-handler.js +94 -0
  41. package/lib/browser/notebook-open-handler.js.map +1 -0
  42. package/lib/browser/notebook-renderer-registry.d.ts +17 -0
  43. package/lib/browser/notebook-renderer-registry.d.ts.map +1 -0
  44. package/lib/browser/notebook-renderer-registry.js +63 -0
  45. package/lib/browser/notebook-renderer-registry.js.map +1 -0
  46. package/lib/browser/notebook-type-registry.d.ts +7 -0
  47. package/lib/browser/notebook-type-registry.d.ts.map +1 -0
  48. package/lib/browser/notebook-type-registry.js +42 -0
  49. package/lib/browser/notebook-type-registry.js.map +1 -0
  50. package/lib/browser/renderers/cell-output-webview.d.ts +12 -0
  51. package/lib/browser/renderers/cell-output-webview.d.ts.map +1 -0
  52. package/lib/browser/renderers/cell-output-webview.js +20 -0
  53. package/lib/browser/renderers/cell-output-webview.js.map +1 -0
  54. package/lib/browser/service/notebook-cell-context-manager.d.ts +16 -0
  55. package/lib/browser/service/notebook-cell-context-manager.d.ts.map +1 -0
  56. package/lib/browser/service/notebook-cell-context-manager.js +83 -0
  57. package/lib/browser/service/notebook-cell-context-manager.js.map +1 -0
  58. package/lib/browser/service/notebook-editor-service.d.ts +22 -0
  59. package/lib/browser/service/notebook-editor-service.d.ts.map +1 -0
  60. package/lib/browser/service/notebook-editor-service.js +95 -0
  61. package/lib/browser/service/notebook-editor-service.js.map +1 -0
  62. package/lib/browser/service/notebook-execution-service.d.ts +25 -0
  63. package/lib/browser/service/notebook-execution-service.d.ts.map +1 -0
  64. package/lib/browser/service/notebook-execution-service.js +140 -0
  65. package/lib/browser/service/notebook-execution-service.js.map +1 -0
  66. package/lib/browser/service/notebook-execution-state-service.d.ts +94 -0
  67. package/lib/browser/service/notebook-execution-state-service.d.ts.map +1 -0
  68. package/lib/browser/service/notebook-execution-state-service.js +250 -0
  69. package/lib/browser/service/notebook-execution-state-service.js.map +1 -0
  70. package/lib/browser/service/notebook-kernel-history-service.d.ts +23 -0
  71. package/lib/browser/service/notebook-kernel-history-service.d.ts.map +1 -0
  72. package/lib/browser/service/notebook-kernel-history-service.js +109 -0
  73. package/lib/browser/service/notebook-kernel-history-service.js.map +1 -0
  74. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts +65 -0
  75. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts.map +1 -0
  76. package/lib/browser/service/notebook-kernel-quick-pick-service.js +430 -0
  77. package/lib/browser/service/notebook-kernel-quick-pick-service.js.map +1 -0
  78. package/lib/browser/service/notebook-kernel-service.d.ts +112 -0
  79. package/lib/browser/service/notebook-kernel-service.d.ts.map +1 -0
  80. package/lib/browser/service/notebook-kernel-service.js +274 -0
  81. package/lib/browser/service/notebook-kernel-service.js.map +1 -0
  82. package/lib/browser/service/notebook-model-resolver-service.d.ts +26 -0
  83. package/lib/browser/service/notebook-model-resolver-service.d.ts.map +1 -0
  84. package/lib/browser/service/notebook-model-resolver-service.js +139 -0
  85. package/lib/browser/service/notebook-model-resolver-service.js.map +1 -0
  86. package/lib/browser/service/notebook-renderer-messaging-service.d.ts +30 -0
  87. package/lib/browser/service/notebook-renderer-messaging-service.d.ts.map +1 -0
  88. package/lib/browser/service/notebook-renderer-messaging-service.js +94 -0
  89. package/lib/browser/service/notebook-renderer-messaging-service.js.map +1 -0
  90. package/lib/browser/service/notebook-service.d.ts +64 -0
  91. package/lib/browser/service/notebook-service.d.ts.map +1 -0
  92. package/lib/browser/service/notebook-service.js +162 -0
  93. package/lib/browser/service/notebook-service.js.map +1 -0
  94. package/lib/browser/view/notebook-cell-editor.d.ts +26 -0
  95. package/lib/browser/view/notebook-cell-editor.d.ts.map +1 -0
  96. package/lib/browser/view/notebook-cell-editor.js +79 -0
  97. package/lib/browser/view/notebook-cell-editor.js.map +1 -0
  98. package/lib/browser/view/notebook-cell-list-view.d.ts +43 -0
  99. package/lib/browser/view/notebook-cell-list-view.d.ts.map +1 -0
  100. package/lib/browser/view/notebook-cell-list-view.js +111 -0
  101. package/lib/browser/view/notebook-cell-list-view.js.map +1 -0
  102. package/lib/browser/view/notebook-cell-toolbar-factory.d.ts +25 -0
  103. package/lib/browser/view/notebook-cell-toolbar-factory.d.ts.map +1 -0
  104. package/lib/browser/view/notebook-cell-toolbar-factory.js +93 -0
  105. package/lib/browser/view/notebook-cell-toolbar-factory.js.map +1 -0
  106. package/lib/browser/view/notebook-cell-toolbar.d.ts +25 -0
  107. package/lib/browser/view/notebook-cell-toolbar.d.ts.map +1 -0
  108. package/lib/browser/view/notebook-cell-toolbar.js +50 -0
  109. package/lib/browser/view/notebook-cell-toolbar.js.map +1 -0
  110. package/lib/browser/view/notebook-code-cell-view.d.ts +47 -0
  111. package/lib/browser/view/notebook-code-cell-view.d.ts.map +1 -0
  112. package/lib/browser/view/notebook-code-cell-view.js +166 -0
  113. package/lib/browser/view/notebook-code-cell-view.js.map +1 -0
  114. package/lib/browser/view/notebook-main-toolbar.d.ts +31 -0
  115. package/lib/browser/view/notebook-main-toolbar.d.ts.map +1 -0
  116. package/lib/browser/view/notebook-main-toolbar.js +118 -0
  117. package/lib/browser/view/notebook-main-toolbar.js.map +1 -0
  118. package/lib/browser/view/notebook-markdown-cell-view.d.ts +12 -0
  119. package/lib/browser/view/notebook-markdown-cell-view.d.ts.map +1 -0
  120. package/lib/browser/view/notebook-markdown-cell-view.js +70 -0
  121. package/lib/browser/view/notebook-markdown-cell-view.js.map +1 -0
  122. package/lib/browser/view-model/notebook-cell-model.d.ts +74 -0
  123. package/lib/browser/view-model/notebook-cell-model.d.ts.map +1 -0
  124. package/lib/browser/view-model/notebook-cell-model.js +226 -0
  125. package/lib/browser/view-model/notebook-cell-model.js.map +1 -0
  126. package/lib/browser/view-model/notebook-cell-output-model.d.ts +19 -0
  127. package/lib/browser/view-model/notebook-cell-output-model.d.ts.map +1 -0
  128. package/lib/browser/view-model/notebook-cell-output-model.js +61 -0
  129. package/lib/browser/view-model/notebook-cell-output-model.js.map +1 -0
  130. package/lib/browser/view-model/notebook-model.d.ts +59 -0
  131. package/lib/browser/view-model/notebook-model.d.ts.map +1 -0
  132. package/lib/browser/view-model/notebook-model.js +315 -0
  133. package/lib/browser/view-model/notebook-model.js.map +1 -0
  134. package/lib/common/index.d.ts +3 -0
  135. package/lib/common/index.d.ts.map +1 -0
  136. package/lib/common/index.js +30 -0
  137. package/lib/common/index.js.map +1 -0
  138. package/lib/common/notebook-common.d.ts +344 -0
  139. package/lib/common/notebook-common.d.ts.map +1 -0
  140. package/lib/common/notebook-common.js +112 -0
  141. package/lib/common/notebook-common.js.map +1 -0
  142. package/lib/common/notebook-protocol.d.ts +21 -0
  143. package/lib/common/notebook-protocol.d.ts.map +1 -0
  144. package/lib/common/notebook-protocol.js +18 -0
  145. package/lib/common/notebook-protocol.js.map +1 -0
  146. package/lib/common/notebook-range.d.ts +14 -0
  147. package/lib/common/notebook-range.d.ts.map +1 -0
  148. package/lib/common/notebook-range.js +18 -0
  149. package/lib/common/notebook-range.js.map +1 -0
  150. package/package.json +52 -0
  151. package/src/browser/contributions/notebook-actions-contribution.ts +171 -0
  152. package/src/browser/contributions/notebook-cell-actions-contribution.ts +204 -0
  153. package/src/browser/contributions/notebook-color-contribution.ts +268 -0
  154. package/src/browser/contributions/notebook-context-keys.ts +99 -0
  155. package/src/browser/index.ts +26 -0
  156. package/src/browser/notebook-cell-resource-resolver.ts +79 -0
  157. package/src/browser/notebook-editor-widget-factory.ts +70 -0
  158. package/src/browser/notebook-editor-widget.tsx +157 -0
  159. package/src/browser/notebook-frontend-module.ts +95 -0
  160. package/src/browser/notebook-open-handler.ts +87 -0
  161. package/src/browser/notebook-renderer-registry.ts +62 -0
  162. package/src/browser/notebook-type-registry.ts +30 -0
  163. package/src/browser/renderers/cell-output-webview.ts +32 -0
  164. package/src/browser/service/notebook-cell-context-manager.ts +70 -0
  165. package/src/browser/service/notebook-editor-service.ts +86 -0
  166. package/src/browser/service/notebook-execution-service.ts +139 -0
  167. package/src/browser/service/notebook-execution-state-service.ts +322 -0
  168. package/src/browser/service/notebook-kernel-history-service.ts +109 -0
  169. package/src/browser/service/notebook-kernel-quick-pick-service.ts +494 -0
  170. package/src/browser/service/notebook-kernel-service.ts +357 -0
  171. package/src/browser/service/notebook-model-resolver-service.ts +141 -0
  172. package/src/browser/service/notebook-renderer-messaging-service.ts +111 -0
  173. package/src/browser/service/notebook-service.ts +178 -0
  174. package/src/browser/style/index.css +236 -0
  175. package/src/browser/view/notebook-cell-editor.tsx +97 -0
  176. package/src/browser/view/notebook-cell-list-view.tsx +171 -0
  177. package/src/browser/view/notebook-cell-toolbar-factory.tsx +91 -0
  178. package/src/browser/view/notebook-cell-toolbar.tsx +70 -0
  179. package/src/browser/view/notebook-code-cell-view.tsx +190 -0
  180. package/src/browser/view/notebook-main-toolbar.tsx +115 -0
  181. package/src/browser/view/notebook-markdown-cell-view.tsx +73 -0
  182. package/src/browser/view-model/notebook-cell-model.ts +271 -0
  183. package/src/browser/view-model/notebook-cell-output-model.ts +69 -0
  184. package/src/browser/view-model/notebook-model.ts +372 -0
  185. package/src/common/index.ts +18 -0
  186. package/src/common/notebook-common.ts +462 -0
  187. package/src/common/notebook-protocol.ts +35 -0
  188. package/src/common/notebook-range.ts +30 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-type-registry.d.ts","sourceRoot":"","sources":["../../src/browser/notebook-type-registry.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBACa,oBAAoB;IAC7B,QAAQ,CAAC,aAAa,EAAE,sBAAsB,EAAE,CAAM;IAEtD,oBAAoB,CAAC,IAAI,EAAE,sBAAsB,GAAG,UAAU;CAMjE"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.NotebookTypeRegistry = void 0;
10
+ // *****************************************************************************
11
+ // Copyright (C) 2023 TypeFox and others.
12
+ //
13
+ // This program and the accompanying materials are made available under the
14
+ // terms of the Eclipse Public License v. 2.0 which is available at
15
+ // http://www.eclipse.org/legal/epl-2.0.
16
+ //
17
+ // This Source Code may also be made available under the following Secondary
18
+ // Licenses when the conditions for such availability set forth in the Eclipse
19
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
20
+ // with the GNU Classpath Exception which is available at
21
+ // https://www.gnu.org/software/classpath/license.html.
22
+ //
23
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
24
+ // *****************************************************************************
25
+ const core_1 = require("@theia/core");
26
+ const inversify_1 = require("@theia/core/shared/inversify");
27
+ let NotebookTypeRegistry = class NotebookTypeRegistry {
28
+ constructor() {
29
+ this.notebookTypes = [];
30
+ }
31
+ registerNotebookType(type) {
32
+ this.notebookTypes.push(type);
33
+ return core_1.Disposable.create(() => {
34
+ this.notebookTypes.splice(this.notebookTypes.indexOf(type), 1);
35
+ });
36
+ }
37
+ };
38
+ NotebookTypeRegistry = __decorate([
39
+ (0, inversify_1.injectable)()
40
+ ], NotebookTypeRegistry);
41
+ exports.NotebookTypeRegistry = NotebookTypeRegistry;
42
+ //# sourceMappingURL=notebook-type-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-type-registry.js","sourceRoot":"","sources":["../../src/browser/notebook-type-registry.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,sCAAyC;AACzC,4DAA0D;AAI1D,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAAjC;QACa,kBAAa,GAA6B,EAAE,CAAC;IAQ1D,CAAC;IANG,oBAAoB,CAAC,IAA4B;QAC7C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,iBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YAC1B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AATY,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAShC;AATY,oDAAoB"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { Disposable } from '@theia/core';
3
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
4
+ export declare const CellOutputWebviewFactory: unique symbol;
5
+ export declare type CellOutputWebviewFactory = (cell: NotebookCellModel) => Promise<CellOutputWebview>;
6
+ export interface CellOutputWebview extends Disposable {
7
+ readonly id: string;
8
+ render(): React.JSX.Element;
9
+ attachWebview(): void;
10
+ isAttached(): boolean;
11
+ }
12
+ //# sourceMappingURL=cell-output-webview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell-output-webview.d.ts","sourceRoot":"","sources":["../../../src/browser/renderers/cell-output-webview.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,eAAiC,CAAC;AAEvE,oBAAY,wBAAwB,GAAG,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/F,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IAEjD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAE5B,aAAa,IAAI,IAAI,CAAC;IACtB,UAAU,IAAI,OAAO,CAAA;CACxB"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CellOutputWebviewFactory = void 0;
19
+ exports.CellOutputWebviewFactory = Symbol('outputWebviewFactory');
20
+ //# sourceMappingURL=cell-output-webview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell-output-webview.js","sourceRoot":"","sources":["../../../src/browser/renderers/cell-output-webview.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAKnE,QAAA,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { ContextKeyService, ScopedValueStore } from '@theia/core/lib/browser/context-key-service';
2
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
3
+ import { Disposable, DisposableCollection, Emitter } from '@theia/core';
4
+ import { NotebookExecutionStateService } from '../service/notebook-execution-state-service';
5
+ export declare class NotebookCellContextManager implements Disposable {
6
+ protected contextKeyService: ContextKeyService;
7
+ protected readonly executionStateService: NotebookExecutionStateService;
8
+ protected readonly toDispose: DisposableCollection;
9
+ protected currentStore: ScopedValueStore;
10
+ protected currentContext: HTMLLIElement;
11
+ protected readonly onDidChangeContextEmitter: Emitter<void>;
12
+ readonly onDidChangeContext: import("@theia/core").Event<void>;
13
+ updateCellContext(cell: NotebookCellModel, newHtmlContext: HTMLLIElement): void;
14
+ dispose(): void;
15
+ }
16
+ //# sourceMappingURL=notebook-cell-context-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-cell-context-manager.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-cell-context-manager.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F,qBACa,0BAA2B,YAAW,UAAU;IAC9B,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;IAExE,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;IAE1D,SAAS,CAAC,YAAY,EAAE,gBAAgB,CAAC;IACzC,SAAS,CAAC,cAAc,EAAE,aAAa,CAAC;IAExC,SAAS,CAAC,QAAQ,CAAC,yBAAyB,gBAAuB;IACnE,QAAQ,CAAC,kBAAkB,oCAAwC;IAEnE,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,GAAG,IAAI;IAyB/E,OAAO,IAAI,IAAI;CAKlB"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.NotebookCellContextManager = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
30
+ const notebook_context_keys_1 = require("../contributions/notebook-context-keys");
31
+ const core_1 = require("@theia/core");
32
+ const common_1 = require("../../common");
33
+ const notebook_execution_state_service_1 = require("../service/notebook-execution-state-service");
34
+ let NotebookCellContextManager = class NotebookCellContextManager {
35
+ constructor() {
36
+ this.toDispose = new core_1.DisposableCollection();
37
+ this.onDidChangeContextEmitter = new core_1.Emitter();
38
+ this.onDidChangeContext = this.onDidChangeContextEmitter.event;
39
+ }
40
+ updateCellContext(cell, newHtmlContext) {
41
+ var _a;
42
+ if (newHtmlContext !== this.currentContext) {
43
+ this.toDispose.dispose();
44
+ (_a = this.currentStore) === null || _a === void 0 ? void 0 : _a.dispose();
45
+ this.currentContext = newHtmlContext;
46
+ this.currentStore = this.contextKeyService.createScoped(newHtmlContext);
47
+ this.currentStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_TYPE, cell.cellKind === common_1.CellKind.Code ? 'code' : 'markdown');
48
+ this.toDispose.push(cell.onDidRequestCellEditChange(cellEdit => {
49
+ var _a;
50
+ (_a = this.currentStore) === null || _a === void 0 ? void 0 : _a.setContext(notebook_context_keys_1.NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, cellEdit);
51
+ this.onDidChangeContextEmitter.fire();
52
+ }));
53
+ this.toDispose.push(this.executionStateService.onDidChangeExecution(e => {
54
+ var _a, _b, _c, _d;
55
+ if (e.affectsCell(cell.uri)) {
56
+ (_a = this.currentStore) === null || _a === void 0 ? void 0 : _a.setContext(notebook_context_keys_1.NOTEBOOK_CELL_EXECUTING, !!e.changed);
57
+ (_b = this.currentStore) === null || _b === void 0 ? void 0 : _b.setContext(notebook_context_keys_1.NOTEBOOK_CELL_EXECUTION_STATE, (_d = (_c = e.changed) === null || _c === void 0 ? void 0 : _c.state) !== null && _d !== void 0 ? _d : 'idle');
58
+ this.onDidChangeContextEmitter.fire();
59
+ }
60
+ }));
61
+ this.onDidChangeContextEmitter.fire();
62
+ }
63
+ }
64
+ dispose() {
65
+ var _a;
66
+ this.toDispose.dispose();
67
+ (_a = this.currentStore) === null || _a === void 0 ? void 0 : _a.dispose();
68
+ this.onDidChangeContextEmitter.dispose();
69
+ }
70
+ };
71
+ __decorate([
72
+ (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
73
+ __metadata("design:type", Object)
74
+ ], NotebookCellContextManager.prototype, "contextKeyService", void 0);
75
+ __decorate([
76
+ (0, inversify_1.inject)(notebook_execution_state_service_1.NotebookExecutionStateService),
77
+ __metadata("design:type", notebook_execution_state_service_1.NotebookExecutionStateService)
78
+ ], NotebookCellContextManager.prototype, "executionStateService", void 0);
79
+ NotebookCellContextManager = __decorate([
80
+ (0, inversify_1.injectable)()
81
+ ], NotebookCellContextManager);
82
+ exports.NotebookCellContextManager = NotebookCellContextManager;
83
+ //# sourceMappingURL=notebook-cell-context-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-cell-context-manager.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-cell-context-manager.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;;;;AAEhF,4DAAkE;AAClE,qFAAkG;AAElG,kFAAsK;AACtK,sCAAwE;AACxE,yCAAwC;AACxC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OAAO,CAAC,CAAC;oBACpE,MAAA,IAAI,CAAC,YAAY,0CAAE,UAAU,CAAC,qDAA6B,EAAE,MAAA,MAAA,CAAC,CAAC,OAAO,0CAAE,KAAK,mCAAI,MAAM,CAAC,CAAC;oBACzF,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC;iBACzC;YACL,CAAC,CAAC,CAAC,CAAC;YACJ,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC;SACzC;IACL,CAAC;IAED,OAAO;;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACzB,MAAA,IAAI,CAAC,YAAY,0CAAE,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,yBAAyB,CAAC,OAAO,EAAE,CAAC;IAC7C,CAAC;CACJ,CAAA;AA3C8B;IAA1B,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;qEAAgD;AAG1E;IADC,IAAA,kBAAM,EAAC,gEAA6B,CAAC;8BACI,gEAA6B;yEAAC;AAJ/D,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CA4CtC;AA5CY,gEAA0B"}
@@ -0,0 +1,22 @@
1
+ import { Disposable } from '@theia/core';
2
+ import { ApplicationShell } from '@theia/core/lib/browser';
3
+ import { NotebookEditorWidget } from '../notebook-editor-widget';
4
+ export declare class NotebookEditorWidgetService implements Disposable {
5
+ protected applicationShell: ApplicationShell;
6
+ private readonly notebookEditors;
7
+ private readonly onNotebookEditorAddEmitter;
8
+ private readonly onNotebookEditorsRemoveEmitter;
9
+ readonly onDidAddNotebookEditor: import("@theia/core").Event<NotebookEditorWidget>;
10
+ readonly onDidRemoveNotebookEditor: import("@theia/core").Event<NotebookEditorWidget>;
11
+ private readonly onFocusedEditorChangedEmitter;
12
+ readonly onFocusedEditorChanged: import("@theia/core").Event<NotebookEditorWidget>;
13
+ private readonly toDispose;
14
+ currentFocusedEditor?: NotebookEditorWidget;
15
+ protected init(): void;
16
+ dispose(): void;
17
+ addNotebookEditor(editor: NotebookEditorWidget): void;
18
+ removeNotebookEditor(editor: NotebookEditorWidget): void;
19
+ getNotebookEditor(editorId: string): NotebookEditorWidget | undefined;
20
+ listNotebookEditors(): readonly NotebookEditorWidget[];
21
+ }
22
+ //# sourceMappingURL=notebook-editor-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-editor-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-editor-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,UAAU,EAAiC,MAAM,aAAa,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAA6B,MAAM,2BAA2B,CAAC;AAE5F,qBACa,2BAA4B,YAAW,UAAU;IAG1D,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA2C;IAE3E,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAuC;IAClF,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAuC;IACtF,QAAQ,CAAC,sBAAsB,oDAAyC;IACxE,QAAQ,CAAC,yBAAyB,oDAA6C;IAE/E,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAAuC;IACrF,QAAQ,CAAC,sBAAsB,oDAA4C;IAE3E,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;IAExD,oBAAoB,CAAC,EAAE,oBAAoB,CAAa;IAGxD,SAAS,CAAC,IAAI,IAAI,IAAI;IAStB,OAAO,IAAI,IAAI;IASf,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAKrD,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAOxD,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAIrE,mBAAmB,IAAI,SAAS,oBAAoB,EAAE;CAIzD"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.NotebookEditorWidgetService = void 0;
28
+ /*---------------------------------------------------------------------------------------------
29
+ * Copyright (c) Microsoft Corporation. All rights reserved.
30
+ * Licensed under the MIT License. See License.txt in the project root for license information.
31
+ *--------------------------------------------------------------------------------------------*/
32
+ const core_1 = require("@theia/core");
33
+ const inversify_1 = require("@theia/core/shared/inversify");
34
+ const browser_1 = require("@theia/core/lib/browser");
35
+ const notebook_editor_widget_1 = require("../notebook-editor-widget");
36
+ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
37
+ constructor() {
38
+ this.notebookEditors = new Map();
39
+ this.onNotebookEditorAddEmitter = new core_1.Emitter();
40
+ this.onNotebookEditorsRemoveEmitter = new core_1.Emitter();
41
+ this.onDidAddNotebookEditor = this.onNotebookEditorAddEmitter.event;
42
+ this.onDidRemoveNotebookEditor = this.onNotebookEditorsRemoveEmitter.event;
43
+ this.onFocusedEditorChangedEmitter = new core_1.Emitter();
44
+ this.onFocusedEditorChanged = this.onFocusedEditorChangedEmitter.event;
45
+ this.toDispose = new core_1.DisposableCollection();
46
+ this.currentFocusedEditor = undefined;
47
+ }
48
+ init() {
49
+ this.toDispose.push(this.applicationShell.onDidChangeActiveWidget(event => {
50
+ var _a;
51
+ if (((_a = event.newValue) === null || _a === void 0 ? void 0 : _a.id.startsWith(notebook_editor_widget_1.NOTEBOOK_EDITOR_ID_PREFIX)) && event.newValue !== this.currentFocusedEditor) {
52
+ this.currentFocusedEditor = event.newValue;
53
+ this.onFocusedEditorChangedEmitter.fire(this.currentFocusedEditor);
54
+ }
55
+ }));
56
+ }
57
+ dispose() {
58
+ this.onNotebookEditorAddEmitter.dispose();
59
+ this.onNotebookEditorsRemoveEmitter.dispose();
60
+ this.onFocusedEditorChangedEmitter.dispose();
61
+ this.toDispose.dispose();
62
+ }
63
+ // --- editor management
64
+ addNotebookEditor(editor) {
65
+ this.notebookEditors.set(editor.id, editor);
66
+ this.onNotebookEditorAddEmitter.fire(editor);
67
+ }
68
+ removeNotebookEditor(editor) {
69
+ if (this.notebookEditors.has(editor.id)) {
70
+ this.notebookEditors.delete(editor.id);
71
+ this.onNotebookEditorsRemoveEmitter.fire(editor);
72
+ }
73
+ }
74
+ getNotebookEditor(editorId) {
75
+ return this.notebookEditors.get(editorId);
76
+ }
77
+ listNotebookEditors() {
78
+ return [...this.notebookEditors].map(e => e[1]);
79
+ }
80
+ };
81
+ __decorate([
82
+ (0, inversify_1.inject)(browser_1.ApplicationShell),
83
+ __metadata("design:type", browser_1.ApplicationShell)
84
+ ], NotebookEditorWidgetService.prototype, "applicationShell", void 0);
85
+ __decorate([
86
+ (0, inversify_1.postConstruct)(),
87
+ __metadata("design:type", Function),
88
+ __metadata("design:paramtypes", []),
89
+ __metadata("design:returntype", void 0)
90
+ ], NotebookEditorWidgetService.prototype, "init", null);
91
+ NotebookEditorWidgetService = __decorate([
92
+ (0, inversify_1.injectable)()
93
+ ], NotebookEditorWidgetService);
94
+ exports.NotebookEditorWidgetService = NotebookEditorWidgetService;
95
+ //# sourceMappingURL=notebook-editor-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-editor-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-editor-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;;;;;;;;AAEhF;;;gGAGgG;AAEhG,sCAAwE;AACxE,4DAAiF;AACjF,qDAA2D;AAC3D,sEAA4F;AAG5F,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAAxC;QAKqB,oBAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;QAE1D,+BAA0B,GAAG,IAAI,cAAO,EAAwB,CAAC;QACjE,mCAA8B,GAAG,IAAI,cAAO,EAAwB,CAAC;QAC7E,2BAAsB,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC;QAC/D,8BAAyB,GAAG,IAAI,CAAC,8BAA8B,CAAC,KAAK,CAAC;QAE9D,kCAA6B,GAAG,IAAI,cAAO,EAAwB,CAAC;QAC5E,2BAAsB,GAAG,IAAI,CAAC,6BAA6B,CAAC,KAAK,CAAC;QAE1D,cAAS,GAAG,IAAI,2BAAoB,EAAE,CAAC;QAExD,yBAAoB,GAA0B,SAAS,CAAC;IAyC5D,CAAC;IAtCa,IAAI;QACV,IAAI,CAAC,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,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;CAEJ,CAAA;AAvDG;IADC,IAAA,kBAAM,EAAC,0BAAgB,CAAC;8BACG,0BAAgB;qEAAC;AAiB7C;IADC,IAAA,yBAAa,GAAE;;;;uDAQf;AA3BQ,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CA0DvC;AA1DY,kEAA2B"}
@@ -0,0 +1,25 @@
1
+ import { CellExecution, NotebookExecutionStateService } from '../service/notebook-execution-state-service';
2
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
3
+ import { NotebookModel } from '../view-model/notebook-model';
4
+ import { NotebookKernelService, NotebookKernel } from './notebook-kernel-service';
5
+ import { CommandService, Disposable } from '@theia/core';
6
+ import { NotebookKernelQuickPickServiceImpl } from './notebook-kernel-quick-pick-service';
7
+ import { NotebookKernelHistoryService } from './notebook-kernel-history-service';
8
+ export interface CellExecutionParticipant {
9
+ onWillExecuteCell(executions: CellExecution[]): Promise<void>;
10
+ }
11
+ export declare class NotebookExecutionService {
12
+ protected notebookExecutionStateService: NotebookExecutionStateService;
13
+ protected notebookKernelService: NotebookKernelService;
14
+ protected notebookKernelHistoryService: NotebookKernelHistoryService;
15
+ protected commandService: CommandService;
16
+ protected notebookKernelQuickPickService: NotebookKernelQuickPickServiceImpl;
17
+ private readonly cellExecutionParticipants;
18
+ executeNotebookCells(notebook: NotebookModel, cells: Iterable<NotebookCellModel>): Promise<void>;
19
+ registerExecutionParticipant(participant: CellExecutionParticipant): Disposable;
20
+ private runExecutionParticipants;
21
+ cancelNotebookCellHandles(notebook: NotebookModel, cells: Iterable<number>): Promise<void>;
22
+ cancelNotebookCells(notebook: NotebookModel, cells: Iterable<NotebookCellModel>): Promise<void>;
23
+ resolveKernel(notebook: NotebookModel): Promise<NotebookKernel | undefined>;
24
+ }
25
+ //# sourceMappingURL=notebook-execution-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-execution-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-execution-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAkC,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1H,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAGjF,MAAM,WAAW,wBAAwB;IACrC,iBAAiB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED,qBACa,wBAAwB;IAGjC,SAAS,CAAC,6BAA6B,EAAE,6BAA6B,CAAC;IAGvE,SAAS,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGvD,SAAS,CAAC,4BAA4B,EAAE,4BAA4B,CAAC;IAGrE,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAGzC,SAAS,CAAC,8BAA8B,EAAE,kCAAkC,CAAC;IAE7E,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAuC;IAE3E,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgDtG,4BAA4B,CAAC,WAAW,EAAE,wBAAwB,GAAG,UAAU;YAKjE,wBAAwB;IAOhC,yBAAyB,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ1F,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/F,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;CAWpF"}
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19
+ * Licensed under the MIT License. See License.txt in the project root for license information.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
22
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
25
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
26
+ };
27
+ var __metadata = (this && this.__metadata) || function (k, v) {
28
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
29
+ };
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.NotebookExecutionService = void 0;
32
+ const inversify_1 = require("@theia/core/shared/inversify");
33
+ const notebook_execution_state_service_1 = require("../service/notebook-execution-state-service");
34
+ const common_1 = require("../../common");
35
+ const notebook_kernel_service_1 = require("./notebook-kernel-service");
36
+ const core_1 = require("@theia/core");
37
+ const notebook_kernel_quick_pick_service_1 = require("./notebook-kernel-quick-pick-service");
38
+ const notebook_kernel_history_service_1 = require("./notebook-kernel-history-service");
39
+ const notebook_actions_contribution_1 = require("../contributions/notebook-actions-contribution");
40
+ let NotebookExecutionService = class NotebookExecutionService {
41
+ constructor() {
42
+ this.cellExecutionParticipants = new Set();
43
+ }
44
+ async executeNotebookCells(notebook, cells) {
45
+ const cellsArr = Array.from(cells)
46
+ .filter(c => c.cellKind === common_1.CellKind.Code);
47
+ if (!cellsArr.length) {
48
+ return;
49
+ }
50
+ // create cell executions
51
+ const cellExecutions = [];
52
+ for (const cell of cellsArr) {
53
+ const cellExe = this.notebookExecutionStateService.getCellExecution(cell.uri);
54
+ if (!cellExe) {
55
+ cellExecutions.push([cell, this.notebookExecutionStateService.createCellExecution(notebook.uri, cell.handle)]);
56
+ }
57
+ }
58
+ const kernel = await this.resolveKernel(notebook);
59
+ if (!kernel) {
60
+ // clear all pending cell executions
61
+ cellExecutions.forEach(cellExe => cellExe[1].complete({}));
62
+ return;
63
+ }
64
+ // filter cell executions based on selected kernel
65
+ const validCellExecutions = [];
66
+ for (const [cell, cellExecution] of cellExecutions) {
67
+ if (!kernel.supportedLanguages.includes(cell.language)) {
68
+ cellExecution.complete({});
69
+ }
70
+ else {
71
+ validCellExecutions.push(cellExecution);
72
+ }
73
+ }
74
+ // request execution
75
+ if (validCellExecutions.length > 0) {
76
+ await this.runExecutionParticipants(validCellExecutions);
77
+ this.notebookKernelService.selectKernelForNotebook(kernel, notebook);
78
+ await kernel.executeNotebookCellsRequest(notebook.uri, validCellExecutions.map(c => c.cellHandle));
79
+ // the connecting state can change before the kernel resolves executeNotebookCellsRequest
80
+ const unconfirmed = validCellExecutions.filter(exe => exe.state === common_1.NotebookCellExecutionState.Unconfirmed);
81
+ if (unconfirmed.length) {
82
+ unconfirmed.forEach(exe => exe.complete({}));
83
+ }
84
+ }
85
+ }
86
+ registerExecutionParticipant(participant) {
87
+ this.cellExecutionParticipants.add(participant);
88
+ return core_1.Disposable.create(() => this.cellExecutionParticipants.delete(participant));
89
+ }
90
+ async runExecutionParticipants(executions) {
91
+ for (const participant of this.cellExecutionParticipants) {
92
+ await participant.onWillExecuteCell(executions);
93
+ }
94
+ return;
95
+ }
96
+ async cancelNotebookCellHandles(notebook, cells) {
97
+ const cellsArr = Array.from(cells);
98
+ const kernel = this.notebookKernelService.getSelectedOrSuggestedKernel(notebook);
99
+ if (kernel) {
100
+ await kernel.cancelNotebookCellExecution(notebook.uri, cellsArr);
101
+ }
102
+ }
103
+ async cancelNotebookCells(notebook, cells) {
104
+ this.cancelNotebookCellHandles(notebook, Array.from(cells, cell => cell.handle));
105
+ }
106
+ async resolveKernel(notebook) {
107
+ const alreadySelected = this.notebookKernelHistoryService.getKernels(notebook);
108
+ if (alreadySelected.selected) {
109
+ return alreadySelected.selected;
110
+ }
111
+ await this.commandService.executeCommand(notebook_actions_contribution_1.NotebookCommands.SELECT_KERNEL_COMMAND.id, notebook);
112
+ const { selected } = this.notebookKernelHistoryService.getKernels(notebook);
113
+ return selected;
114
+ }
115
+ };
116
+ __decorate([
117
+ (0, inversify_1.inject)(notebook_execution_state_service_1.NotebookExecutionStateService),
118
+ __metadata("design:type", notebook_execution_state_service_1.NotebookExecutionStateService)
119
+ ], NotebookExecutionService.prototype, "notebookExecutionStateService", void 0);
120
+ __decorate([
121
+ (0, inversify_1.inject)(notebook_kernel_service_1.NotebookKernelService),
122
+ __metadata("design:type", notebook_kernel_service_1.NotebookKernelService)
123
+ ], NotebookExecutionService.prototype, "notebookKernelService", void 0);
124
+ __decorate([
125
+ (0, inversify_1.inject)(notebook_kernel_history_service_1.NotebookKernelHistoryService),
126
+ __metadata("design:type", notebook_kernel_history_service_1.NotebookKernelHistoryService)
127
+ ], NotebookExecutionService.prototype, "notebookKernelHistoryService", void 0);
128
+ __decorate([
129
+ (0, inversify_1.inject)(core_1.CommandService),
130
+ __metadata("design:type", Object)
131
+ ], NotebookExecutionService.prototype, "commandService", void 0);
132
+ __decorate([
133
+ (0, inversify_1.inject)(notebook_kernel_quick_pick_service_1.NotebookKernelQuickPickService),
134
+ __metadata("design:type", notebook_kernel_quick_pick_service_1.NotebookKernelQuickPickServiceImpl)
135
+ ], NotebookExecutionService.prototype, "notebookKernelQuickPickService", void 0);
136
+ NotebookExecutionService = __decorate([
137
+ (0, inversify_1.injectable)()
138
+ ], NotebookExecutionService);
139
+ exports.NotebookExecutionService = NotebookExecutionService;
140
+ //# sourceMappingURL=notebook-execution-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-execution-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-execution-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF;;;gGAGgG;;;;;;;;;;;;AAEhG,4DAAkE;AAClE,kGAA2G;AAC3G,yCAAoE;AAGpE,uEAAkF;AAClF,sCAAyD;AACzD,6FAA0H;AAC1H,uFAAiF;AACjF,kGAAkF;AAOlF,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAArC;QAiBqB,8BAAyB,GAAG,IAAI,GAAG,EAA4B,CAAC;IAqFrF,CAAC;IAnFG,KAAK,CAAC,oBAAoB,CAAC,QAAuB,EAAE,KAAkC;QAClF,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;aAC7B,MAAM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AQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SACpE;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,QAAuB,EAAE,KAAkC;QACjF,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAuB;QACvC,MAAM,eAAe,GAAG,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAE/E,IAAI,eAAe,CAAC,QAAQ,EAAE;YAC1B,OAAO,eAAe,CAAC,QAAQ,CAAC;SACnC;QAED,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,gDAAgB,CAAC,qBAAqB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC9F,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAA;AAnGG;IADC,IAAA,kBAAM,EAAC,gEAA6B,CAAC;8BACG,gEAA6B;+EAAC;AAGvE;IADC,IAAA,kBAAM,EAAC,+CAAqB,CAAC;8BACG,+CAAqB;uEAAC;AAGvD;IADC,IAAA,kBAAM,EAAC,8DAA4B,CAAC;8BACG,8DAA4B;8EAAC;AAGrE;IADC,IAAA,kBAAM,EAAC,qBAAc,CAAC;;gEACkB;AAGzC;IADC,IAAA,kBAAM,EAAC,mEAA8B,CAAC;8BACG,uEAAkC;gFAAC;AAfpE,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAsGpC;AAtGY,4DAAwB"}
@@ -0,0 +1,94 @@
1
+ import { Disposable, URI } from '@theia/core';
2
+ import { NotebookService } from './notebook-service';
3
+ import { CellExecuteOutputEdit, CellExecuteOutputItemEdit, CellExecutionUpdateType, NotebookCellExecutionState, CellEditOperation } from '../../common';
4
+ import { NotebookModel } from '../view-model/notebook-model';
5
+ export declare type CellExecuteUpdate = CellExecuteOutputEdit | CellExecuteOutputItemEdit | CellExecutionStateUpdate;
6
+ export interface CellExecutionComplete {
7
+ runEndTime?: number;
8
+ lastRunSuccess?: boolean;
9
+ }
10
+ export interface CellExecutionStateUpdate {
11
+ editType: CellExecutionUpdateType.ExecutionState;
12
+ executionOrder?: number;
13
+ runStartTime?: number;
14
+ didPause?: boolean;
15
+ isPaused?: boolean;
16
+ }
17
+ export interface ICellExecutionStateUpdate {
18
+ editType: CellExecutionUpdateType.ExecutionState;
19
+ executionOrder?: number;
20
+ runStartTime?: number;
21
+ didPause?: boolean;
22
+ isPaused?: boolean;
23
+ }
24
+ export interface ICellExecutionStateUpdate {
25
+ editType: CellExecutionUpdateType.ExecutionState;
26
+ executionOrder?: number;
27
+ runStartTime?: number;
28
+ didPause?: boolean;
29
+ isPaused?: boolean;
30
+ }
31
+ export interface ICellExecutionComplete {
32
+ runEndTime?: number;
33
+ lastRunSuccess?: boolean;
34
+ }
35
+ export declare enum NotebookExecutionType {
36
+ cell = 0,
37
+ notebook = 1
38
+ }
39
+ export interface NotebookFailStateChangedEvent {
40
+ visible: boolean;
41
+ notebook: URI;
42
+ }
43
+ export interface FailedCellInfo {
44
+ cellHandle: number;
45
+ disposable: Disposable;
46
+ visible: boolean;
47
+ }
48
+ export declare class NotebookExecutionStateService implements Disposable {
49
+ protected notebookService: NotebookService;
50
+ protected readonly executions: Map<string, CellExecution>;
51
+ private readonly onDidChangeExecutionEmitter;
52
+ onDidChangeExecution: import("@theia/core").Event<CellExecutionStateChangedEvent>;
53
+ private readonly onDidChangeLastRunFailStateEmitter;
54
+ onDidChangeLastRunFailState: import("@theia/core").Event<NotebookFailStateChangedEvent>;
55
+ createCellExecution(notebookUri: URI, cellHandle: number): CellExecution;
56
+ private createNotebookCellExecution;
57
+ private onCellExecutionDidComplete;
58
+ getCellExecution(cellUri: URI): CellExecution | undefined;
59
+ dispose(): void;
60
+ }
61
+ export declare class CellExecution implements Disposable {
62
+ readonly cellHandle: number;
63
+ private readonly notebook;
64
+ private readonly onDidUpdateEmitter;
65
+ readonly onDidUpdate: import("@theia/core").Event<void>;
66
+ private readonly onDidCompleteEmitter;
67
+ readonly onDidComplete: import("@theia/core").Event<boolean | undefined>;
68
+ private _state;
69
+ get state(): NotebookCellExecutionState;
70
+ get notebookURI(): URI;
71
+ private _didPause;
72
+ get didPause(): boolean;
73
+ private _isPaused;
74
+ get isPaused(): boolean;
75
+ constructor(cellHandle: number, notebook: NotebookModel);
76
+ initialize(): void;
77
+ private getCellLog;
78
+ confirm(): void;
79
+ update(updates: CellExecuteUpdate[]): void;
80
+ complete(completionData: CellExecutionComplete): void;
81
+ dispose(): void;
82
+ private applyExecutionEdits;
83
+ }
84
+ export declare class CellExecutionStateChangedEvent {
85
+ readonly notebook: URI;
86
+ readonly cellHandle: number;
87
+ readonly changed?: CellExecution | undefined;
88
+ readonly type = NotebookExecutionType.cell;
89
+ constructor(notebook: URI, cellHandle: number, changed?: CellExecution | undefined);
90
+ affectsCell(cell: URI): boolean;
91
+ affectsNotebook(notebook: URI): boolean;
92
+ }
93
+ export declare function updateToEdit(update: CellExecuteUpdate, cellHandle: number): CellEditOperation;
94
+ //# sourceMappingURL=notebook-execution-state-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-execution-state-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-execution-state-service.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAAW,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACW,qBAAqB,EAAE,yBAAyB,EAAE,uBAAuB,EACrC,0BAA0B,EAAE,iBAAiB,EAClG,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM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