@theia/notebook 1.67.0-next.56 → 1.67.0-next.86

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 (229) hide show
  1. package/lib/browser/contributions/cell-operations.d.ts +8 -0
  2. package/lib/browser/contributions/cell-operations.d.ts.map +1 -0
  3. package/lib/browser/contributions/cell-operations.js +45 -0
  4. package/lib/browser/contributions/cell-operations.js.map +1 -0
  5. package/lib/browser/contributions/notebook-actions-contribution.d.ts +48 -0
  6. package/lib/browser/contributions/notebook-actions-contribution.d.ts.map +1 -0
  7. package/lib/browser/contributions/notebook-actions-contribution.js +344 -0
  8. package/lib/browser/contributions/notebook-actions-contribution.js.map +1 -0
  9. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts +66 -0
  10. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts.map +1 -0
  11. package/lib/browser/contributions/notebook-cell-actions-contribution.js +526 -0
  12. package/lib/browser/contributions/notebook-cell-actions-contribution.js.map +1 -0
  13. package/lib/browser/contributions/notebook-color-contribution.d.ts +6 -0
  14. package/lib/browser/contributions/notebook-color-contribution.d.ts.map +1 -0
  15. package/lib/browser/contributions/notebook-color-contribution.js +247 -0
  16. package/lib/browser/contributions/notebook-color-contribution.js.map +1 -0
  17. package/lib/browser/contributions/notebook-context-keys.d.ts +44 -0
  18. package/lib/browser/contributions/notebook-context-keys.d.ts.map +1 -0
  19. package/lib/browser/contributions/notebook-context-keys.js +108 -0
  20. package/lib/browser/contributions/notebook-context-keys.js.map +1 -0
  21. package/lib/browser/contributions/notebook-label-provider-contribution.d.ts +19 -0
  22. package/lib/browser/contributions/notebook-label-provider-contribution.d.ts.map +1 -0
  23. package/lib/browser/contributions/notebook-label-provider-contribution.js +86 -0
  24. package/lib/browser/contributions/notebook-label-provider-contribution.js.map +1 -0
  25. package/lib/browser/contributions/notebook-outline-contribution.d.ts +29 -0
  26. package/lib/browser/contributions/notebook-outline-contribution.d.ts.map +1 -0
  27. package/lib/browser/contributions/notebook-outline-contribution.js +115 -0
  28. package/lib/browser/contributions/notebook-outline-contribution.js.map +1 -0
  29. package/lib/browser/contributions/notebook-output-action-contribution.d.ts +16 -0
  30. package/lib/browser/contributions/notebook-output-action-contribution.d.ts.map +1 -0
  31. package/lib/browser/contributions/notebook-output-action-contribution.js +83 -0
  32. package/lib/browser/contributions/notebook-output-action-contribution.js.map +1 -0
  33. package/lib/browser/contributions/notebook-status-bar-contribution.d.ts +12 -0
  34. package/lib/browser/contributions/notebook-status-bar-contribution.d.ts.map +1 -0
  35. package/lib/browser/contributions/notebook-status-bar-contribution.js +61 -0
  36. package/lib/browser/contributions/notebook-status-bar-contribution.js.map +1 -0
  37. package/lib/browser/contributions/notebook-undo-redo-handler.d.ts +10 -0
  38. package/lib/browser/contributions/notebook-undo-redo-handler.d.ts.map +1 -0
  39. package/lib/browser/contributions/notebook-undo-redo-handler.js +49 -0
  40. package/lib/browser/contributions/notebook-undo-redo-handler.js.map +1 -0
  41. package/lib/browser/index.d.ts +14 -0
  42. package/lib/browser/index.d.ts.map +1 -0
  43. package/lib/browser/index.js +32 -0
  44. package/lib/browser/index.js.map +1 -0
  45. package/lib/browser/notebook-cell-open-handler.d.ts +10 -0
  46. package/lib/browser/notebook-cell-open-handler.d.ts.map +1 -0
  47. package/lib/browser/notebook-cell-open-handler.js +52 -0
  48. package/lib/browser/notebook-cell-open-handler.js.map +1 -0
  49. package/lib/browser/notebook-cell-resource-resolver.d.ts +26 -0
  50. package/lib/browser/notebook-cell-resource-resolver.d.ts.map +1 -0
  51. package/lib/browser/notebook-cell-resource-resolver.js +109 -0
  52. package/lib/browser/notebook-cell-resource-resolver.js.map +1 -0
  53. package/lib/browser/notebook-editor-split-contribution.d.ts +14 -0
  54. package/lib/browser/notebook-editor-split-contribution.d.ts.map +1 -0
  55. package/lib/browser/notebook-editor-split-contribution.js +51 -0
  56. package/lib/browser/notebook-editor-split-contribution.js.map +1 -0
  57. package/lib/browser/notebook-editor-widget-factory.d.ts +20 -0
  58. package/lib/browser/notebook-editor-widget-factory.d.ts.map +1 -0
  59. package/lib/browser/notebook-editor-widget-factory.js +101 -0
  60. package/lib/browser/notebook-editor-widget-factory.js.map +1 -0
  61. package/lib/browser/notebook-editor-widget.d.ts +102 -0
  62. package/lib/browser/notebook-editor-widget.d.ts.map +1 -0
  63. package/lib/browser/notebook-editor-widget.js +336 -0
  64. package/lib/browser/notebook-editor-widget.js.map +1 -0
  65. package/lib/browser/notebook-frontend-module.d.ts +5 -0
  66. package/lib/browser/notebook-frontend-module.d.ts.map +1 -0
  67. package/lib/browser/notebook-frontend-module.js +116 -0
  68. package/lib/browser/notebook-frontend-module.js.map +1 -0
  69. package/lib/browser/notebook-open-handler.d.ts +29 -0
  70. package/lib/browser/notebook-open-handler.d.ts.map +1 -0
  71. package/lib/browser/notebook-open-handler.js +119 -0
  72. package/lib/browser/notebook-open-handler.js.map +1 -0
  73. package/lib/browser/notebook-output-utils.d.ts +13 -0
  74. package/lib/browser/notebook-output-utils.d.ts.map +1 -0
  75. package/lib/browser/notebook-output-utils.js +112 -0
  76. package/lib/browser/notebook-output-utils.js.map +1 -0
  77. package/lib/browser/notebook-renderer-registry.d.ts +25 -0
  78. package/lib/browser/notebook-renderer-registry.d.ts.map +1 -0
  79. package/lib/browser/notebook-renderer-registry.js +72 -0
  80. package/lib/browser/notebook-renderer-registry.js.map +1 -0
  81. package/lib/browser/notebook-type-registry.d.ts +12 -0
  82. package/lib/browser/notebook-type-registry.d.ts.map +1 -0
  83. package/lib/browser/notebook-type-registry.js +60 -0
  84. package/lib/browser/notebook-type-registry.js.map +1 -0
  85. package/lib/browser/notebook-types.d.ts +131 -0
  86. package/lib/browser/notebook-types.d.ts.map +1 -0
  87. package/lib/browser/notebook-types.js +28 -0
  88. package/lib/browser/notebook-types.js.map +1 -0
  89. package/lib/browser/renderers/cell-output-webview.d.ts +26 -0
  90. package/lib/browser/renderers/cell-output-webview.d.ts.map +1 -0
  91. package/lib/browser/renderers/cell-output-webview.js +21 -0
  92. package/lib/browser/renderers/cell-output-webview.js.map +1 -0
  93. package/lib/browser/service/notebook-cell-editor-service.d.ts +23 -0
  94. package/lib/browser/service/notebook-cell-editor-service.d.ts.map +1 -0
  95. package/lib/browser/service/notebook-cell-editor-service.js +89 -0
  96. package/lib/browser/service/notebook-cell-editor-service.js.map +1 -0
  97. package/lib/browser/service/notebook-cell-status-bar-service.d.ts +39 -0
  98. package/lib/browser/service/notebook-cell-status-bar-service.d.ts.map +1 -0
  99. package/lib/browser/service/notebook-cell-status-bar-service.js +69 -0
  100. package/lib/browser/service/notebook-cell-status-bar-service.js.map +1 -0
  101. package/lib/browser/service/notebook-clipboard-service.d.ts +10 -0
  102. package/lib/browser/service/notebook-clipboard-service.d.ts.map +1 -0
  103. package/lib/browser/service/notebook-clipboard-service.js +42 -0
  104. package/lib/browser/service/notebook-clipboard-service.js.map +1 -0
  105. package/lib/browser/service/notebook-context-manager.d.ts +28 -0
  106. package/lib/browser/service/notebook-context-manager.d.ts.map +1 -0
  107. package/lib/browser/service/notebook-context-manager.js +135 -0
  108. package/lib/browser/service/notebook-context-manager.js.map +1 -0
  109. package/lib/browser/service/notebook-editor-widget-service.d.ts +27 -0
  110. package/lib/browser/service/notebook-editor-widget-service.d.ts.map +1 -0
  111. package/lib/browser/service/notebook-editor-widget-service.js +124 -0
  112. package/lib/browser/service/notebook-editor-widget-service.js.map +1 -0
  113. package/lib/browser/service/notebook-execution-service.d.ts +25 -0
  114. package/lib/browser/service/notebook-execution-service.d.ts.map +1 -0
  115. package/lib/browser/service/notebook-execution-service.js +150 -0
  116. package/lib/browser/service/notebook-execution-service.js.map +1 -0
  117. package/lib/browser/service/notebook-execution-state-service.d.ts +78 -0
  118. package/lib/browser/service/notebook-execution-state-service.d.ts.map +1 -0
  119. package/lib/browser/service/notebook-execution-state-service.js +247 -0
  120. package/lib/browser/service/notebook-execution-state-service.js.map +1 -0
  121. package/lib/browser/service/notebook-kernel-history-service.d.ts +28 -0
  122. package/lib/browser/service/notebook-kernel-history-service.d.ts.map +1 -0
  123. package/lib/browser/service/notebook-kernel-history-service.js +116 -0
  124. package/lib/browser/service/notebook-kernel-history-service.js.map +1 -0
  125. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts +61 -0
  126. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts.map +1 -0
  127. package/lib/browser/service/notebook-kernel-quick-pick-service.js +425 -0
  128. package/lib/browser/service/notebook-kernel-quick-pick-service.js.map +1 -0
  129. package/lib/browser/service/notebook-kernel-service.d.ts +125 -0
  130. package/lib/browser/service/notebook-kernel-service.d.ts.map +1 -0
  131. package/lib/browser/service/notebook-kernel-service.js +268 -0
  132. package/lib/browser/service/notebook-kernel-service.js.map +1 -0
  133. package/lib/browser/service/notebook-model-resolver-service.d.ts +28 -0
  134. package/lib/browser/service/notebook-model-resolver-service.d.ts.map +1 -0
  135. package/lib/browser/service/notebook-model-resolver-service.js +157 -0
  136. package/lib/browser/service/notebook-model-resolver-service.js.map +1 -0
  137. package/lib/browser/service/notebook-monaco-text-model-service.d.ts +21 -0
  138. package/lib/browser/service/notebook-monaco-text-model-service.d.ts.map +1 -0
  139. package/lib/browser/service/notebook-monaco-text-model-service.js +73 -0
  140. package/lib/browser/service/notebook-monaco-text-model-service.js.map +1 -0
  141. package/lib/browser/service/notebook-options.d.ts +30 -0
  142. package/lib/browser/service/notebook-options.d.ts.map +1 -0
  143. package/lib/browser/service/notebook-options.js +130 -0
  144. package/lib/browser/service/notebook-options.js.map +1 -0
  145. package/lib/browser/service/notebook-renderer-messaging-service.d.ts +35 -0
  146. package/lib/browser/service/notebook-renderer-messaging-service.d.ts.map +1 -0
  147. package/lib/browser/service/notebook-renderer-messaging-service.js +100 -0
  148. package/lib/browser/service/notebook-renderer-messaging-service.js.map +1 -0
  149. package/lib/browser/service/notebook-service.d.ts +68 -0
  150. package/lib/browser/service/notebook-service.d.ts.map +1 -0
  151. package/lib/browser/service/notebook-service.js +184 -0
  152. package/lib/browser/service/notebook-service.js.map +1 -0
  153. package/lib/browser/view/notebook-cell-editor.d.ts +46 -0
  154. package/lib/browser/view/notebook-cell-editor.d.ts.map +1 -0
  155. package/lib/browser/view/notebook-cell-editor.js +271 -0
  156. package/lib/browser/view/notebook-cell-editor.js.map +1 -0
  157. package/lib/browser/view/notebook-cell-list-view.d.ts +58 -0
  158. package/lib/browser/view/notebook-cell-list-view.d.ts.map +1 -0
  159. package/lib/browser/view/notebook-cell-list-view.js +225 -0
  160. package/lib/browser/view/notebook-cell-list-view.js.map +1 -0
  161. package/lib/browser/view/notebook-cell-toolbar-factory.d.ts +33 -0
  162. package/lib/browser/view/notebook-cell-toolbar-factory.d.ts.map +1 -0
  163. package/lib/browser/view/notebook-cell-toolbar-factory.js +110 -0
  164. package/lib/browser/view/notebook-cell-toolbar-factory.js.map +1 -0
  165. package/lib/browser/view/notebook-cell-toolbar.d.ts +25 -0
  166. package/lib/browser/view/notebook-cell-toolbar.d.ts.map +1 -0
  167. package/lib/browser/view/notebook-cell-toolbar.js +51 -0
  168. package/lib/browser/view/notebook-cell-toolbar.js.map +1 -0
  169. package/lib/browser/view/notebook-code-cell-view.d.ts +93 -0
  170. package/lib/browser/view/notebook-code-cell-view.d.ts.map +1 -0
  171. package/lib/browser/view/notebook-code-cell-view.js +338 -0
  172. package/lib/browser/view/notebook-code-cell-view.js.map +1 -0
  173. package/lib/browser/view/notebook-find-widget.d.ts +63 -0
  174. package/lib/browser/view/notebook-find-widget.d.ts.map +1 -0
  175. package/lib/browser/view/notebook-find-widget.js +225 -0
  176. package/lib/browser/view/notebook-find-widget.js.map +1 -0
  177. package/lib/browser/view/notebook-main-toolbar.d.ts +53 -0
  178. package/lib/browser/view/notebook-main-toolbar.d.ts.map +1 -0
  179. package/lib/browser/view/notebook-main-toolbar.js +184 -0
  180. package/lib/browser/view/notebook-main-toolbar.js.map +1 -0
  181. package/lib/browser/view/notebook-markdown-cell-view.d.ts +28 -0
  182. package/lib/browser/view/notebook-markdown-cell-view.d.ts.map +1 -0
  183. package/lib/browser/view/notebook-markdown-cell-view.js +216 -0
  184. package/lib/browser/view/notebook-markdown-cell-view.js.map +1 -0
  185. package/lib/browser/view/notebook-viewport-service.d.ts +17 -0
  186. package/lib/browser/view/notebook-viewport-service.d.ts.map +1 -0
  187. package/lib/browser/view/notebook-viewport-service.js +61 -0
  188. package/lib/browser/view/notebook-viewport-service.js.map +1 -0
  189. package/lib/browser/view-model/notebook-cell-model.d.ts +137 -0
  190. package/lib/browser/view-model/notebook-cell-model.d.ts.map +1 -0
  191. package/lib/browser/view-model/notebook-cell-model.js +367 -0
  192. package/lib/browser/view-model/notebook-cell-model.js.map +1 -0
  193. package/lib/browser/view-model/notebook-cell-output-model.d.ts +17 -0
  194. package/lib/browser/view-model/notebook-cell-output-model.d.ts.map +1 -0
  195. package/lib/browser/view-model/notebook-cell-output-model.js +87 -0
  196. package/lib/browser/view-model/notebook-cell-output-model.js.map +1 -0
  197. package/lib/browser/view-model/notebook-model.d.ts +85 -0
  198. package/lib/browser/view-model/notebook-model.d.ts.map +1 -0
  199. package/lib/browser/view-model/notebook-model.js +446 -0
  200. package/lib/browser/view-model/notebook-model.js.map +1 -0
  201. package/lib/browser/view-model/notebook-view-model.d.ts +40 -0
  202. package/lib/browser/view-model/notebook-view-model.d.ts.map +1 -0
  203. package/lib/browser/view-model/notebook-view-model.js +120 -0
  204. package/lib/browser/view-model/notebook-view-model.js.map +1 -0
  205. package/lib/common/index.d.ts +3 -0
  206. package/lib/common/index.d.ts.map +1 -0
  207. package/lib/common/index.js +21 -0
  208. package/lib/common/index.js.map +1 -0
  209. package/lib/common/notebook-common.d.ts +227 -0
  210. package/lib/common/notebook-common.d.ts.map +1 -0
  211. package/lib/common/notebook-common.js +151 -0
  212. package/lib/common/notebook-common.js.map +1 -0
  213. package/lib/common/notebook-preferences.d.ts +15 -0
  214. package/lib/common/notebook-preferences.d.ts.map +1 -0
  215. package/lib/common/notebook-preferences.js +89 -0
  216. package/lib/common/notebook-preferences.js.map +1 -0
  217. package/lib/common/notebook-protocol.d.ts +21 -0
  218. package/lib/common/notebook-protocol.d.ts.map +1 -0
  219. package/lib/common/notebook-protocol.js +18 -0
  220. package/lib/common/notebook-protocol.js.map +1 -0
  221. package/lib/common/notebook-range.d.ts +14 -0
  222. package/lib/common/notebook-range.d.ts.map +1 -0
  223. package/lib/common/notebook-range.js +18 -0
  224. package/lib/common/notebook-range.js.map +1 -0
  225. package/lib/node/notebook-backend-module.d.ts +4 -0
  226. package/lib/node/notebook-backend-module.d.ts.map +1 -0
  227. package/lib/node/notebook-backend-module.js +23 -0
  228. package/lib/node/notebook-backend-module.js.map +1 -0
  229. package/package.json +7 -7
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import { Disposable, Event } from '@theia/core';
3
+ import { NotebookModel } from '../view-model/notebook-model';
4
+ import { NotebookEditorWidget } from '../notebook-editor-widget';
5
+ import { NotebookContentChangedEvent } from '../notebook-types';
6
+ import { NotebookCellOutputModel } from '../view-model/notebook-cell-output-model';
7
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
8
+ export declare const CellOutputWebviewFactory: unique symbol;
9
+ export declare const CellOutputWebview: unique symbol;
10
+ export type CellOutputWebviewFactory = () => Promise<CellOutputWebview>;
11
+ export interface OutputRenderEvent {
12
+ cellHandle: number;
13
+ outputId: string;
14
+ outputHeight: number;
15
+ }
16
+ export interface CellOutputWebview extends Disposable {
17
+ readonly id: string;
18
+ init(notebook: NotebookModel, editor: NotebookEditorWidget): void;
19
+ render(): React.ReactNode;
20
+ setCellHeight(cell: NotebookCellModel, height: number): void;
21
+ cellsChanged(cellEvent: NotebookContentChangedEvent[]): void;
22
+ onDidRenderOutput: Event<OutputRenderEvent>;
23
+ requestOutputPresentationUpdate(cellHandle: number, output: NotebookCellOutputModel): void;
24
+ isAttached(): boolean;
25
+ }
26
+ //# sourceMappingURL=cell-output-webview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell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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.CellOutputWebview = exports.CellOutputWebviewFactory = void 0;
19
+ exports.CellOutputWebviewFactory = Symbol('outputWebviewFactory');
20
+ exports.CellOutputWebview = Symbol('outputWebview');
21
+ //# 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;;;AASnE,QAAA,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC1D,QAAA,iBAAiB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Emitter, URI } from '@theia/core';
2
+ import { SimpleMonacoEditor } from '@theia/monaco/lib/browser/simple-monaco-editor';
3
+ import { NotebookEditorWidgetService } from './notebook-editor-widget-service';
4
+ import { ActiveMonacoEditorContribution, MonacoEditorService } from '@theia/monaco/lib/browser/monaco-editor-service';
5
+ import { ICodeEditor } from '@theia/monaco-editor-core/esm/vs/editor/browser/editorBrowser';
6
+ export declare class NotebookCellEditorService implements ActiveMonacoEditorContribution {
7
+ protected readonly notebookEditorWidgetService: NotebookEditorWidgetService;
8
+ protected readonly monacoEditorService: MonacoEditorService;
9
+ protected onDidChangeCellEditorsEmitter: Emitter<void>;
10
+ readonly onDidChangeCellEditors: import("@theia/core").Event<void>;
11
+ protected onDidChangeFocusedCellEditorEmitter: Emitter<SimpleMonacoEditor | undefined>;
12
+ readonly onDidChangeFocusedCellEditor: import("@theia/core").Event<SimpleMonacoEditor | undefined>;
13
+ protected currentActiveCell?: SimpleMonacoEditor;
14
+ protected currentCellEditors: Map<string, SimpleMonacoEditor>;
15
+ protected init(): void;
16
+ get allCellEditors(): SimpleMonacoEditor[];
17
+ editorCreated(uri: URI, editor: SimpleMonacoEditor): void;
18
+ editorDisposed(uri: URI): void;
19
+ editorFocusChanged(editor?: SimpleMonacoEditor): void;
20
+ getActiveCell(): SimpleMonacoEditor | undefined;
21
+ getActiveEditor(): ICodeEditor | undefined;
22
+ }
23
+ //# sourceMappingURL=notebook-cell-editor-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-cell-editor-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-cell-editor-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtH,OAAO,EAAE,WAAW,EAAE,MAAM,+DAA+D,CAAC;AAE5F,qBACa,yBAA0B,YAAW,8BAA8B;IAG5E,SAAS,CAAC,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B,CAAC;IAG5E,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAE5D,SAAS,CAAC,6BAA6B,gBAAuB;IAC9D,QAAQ,CAAC,sBAAsB,oCAA4C;IAE3E,SAAS,CAAC,mCAAmC,0CAAiD;IAC9F,QAAQ,CAAC,4BAA4B,8DAAkD;IAEvF,SAAS,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IAEjD,SAAS,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAa;IAG1E,SAAS,CAAC,IAAI,IAAI,IAAI;IAYtB,IAAI,cAAc,IAAI,kBAAkB,EAAE,CAEzC;IAED,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAKzD,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAK9B,kBAAkB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,IAAI;IAQrD,aAAa,IAAI,kBAAkB,GAAG,SAAS;IAI/C,eAAe,IAAI,WAAW,GAAG,SAAS;CAG7C"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.NotebookCellEditorService = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const core_1 = require("@theia/core");
21
+ const inversify_1 = require("@theia/core/shared/inversify");
22
+ const notebook_editor_widget_service_1 = require("./notebook-editor-widget-service");
23
+ const common_1 = require("../../common");
24
+ const monaco_editor_service_1 = require("@theia/monaco/lib/browser/monaco-editor-service");
25
+ let NotebookCellEditorService = class NotebookCellEditorService {
26
+ constructor() {
27
+ this.onDidChangeCellEditorsEmitter = new core_1.Emitter();
28
+ this.onDidChangeCellEditors = this.onDidChangeCellEditorsEmitter.event;
29
+ this.onDidChangeFocusedCellEditorEmitter = new core_1.Emitter();
30
+ this.onDidChangeFocusedCellEditor = this.onDidChangeFocusedCellEditorEmitter.event;
31
+ this.currentCellEditors = new Map();
32
+ }
33
+ init() {
34
+ this.notebookEditorWidgetService.onDidChangeCurrentEditor(editor => {
35
+ var _a, _b;
36
+ // if defocus notebook editor or another notebook editor is focused, clear the active cell
37
+ if (!editor || (this.currentActiveCell && ((_a = common_1.CellUri.parse(this.currentActiveCell.uri)) === null || _a === void 0 ? void 0 : _a.notebook.toString()) !== ((_b = editor === null || editor === void 0 ? void 0 : editor.model) === null || _b === void 0 ? void 0 : _b.uri.toString()))) {
38
+ this.currentActiveCell = undefined;
39
+ // eslint-disable-next-line no-null/no-null
40
+ this.monacoEditorService.setActiveCodeEditor(null);
41
+ this.onDidChangeFocusedCellEditorEmitter.fire(undefined);
42
+ }
43
+ });
44
+ }
45
+ get allCellEditors() {
46
+ return Array.from(this.currentCellEditors.values());
47
+ }
48
+ editorCreated(uri, editor) {
49
+ this.currentCellEditors.set(uri.toString(), editor);
50
+ this.onDidChangeCellEditorsEmitter.fire();
51
+ }
52
+ editorDisposed(uri) {
53
+ this.currentCellEditors.delete(uri.toString());
54
+ this.onDidChangeCellEditorsEmitter.fire();
55
+ }
56
+ editorFocusChanged(editor) {
57
+ if (editor) {
58
+ this.currentActiveCell = editor;
59
+ this.monacoEditorService.setActiveCodeEditor(editor.getControl());
60
+ this.onDidChangeFocusedCellEditorEmitter.fire(editor);
61
+ }
62
+ }
63
+ getActiveCell() {
64
+ return this.currentActiveCell;
65
+ }
66
+ getActiveEditor() {
67
+ var _a;
68
+ return (_a = this.getActiveCell()) === null || _a === void 0 ? void 0 : _a.getControl();
69
+ }
70
+ };
71
+ exports.NotebookCellEditorService = NotebookCellEditorService;
72
+ tslib_1.__decorate([
73
+ (0, inversify_1.inject)(notebook_editor_widget_service_1.NotebookEditorWidgetService),
74
+ tslib_1.__metadata("design:type", notebook_editor_widget_service_1.NotebookEditorWidgetService)
75
+ ], NotebookCellEditorService.prototype, "notebookEditorWidgetService", void 0);
76
+ tslib_1.__decorate([
77
+ (0, inversify_1.inject)(monaco_editor_service_1.MonacoEditorService),
78
+ tslib_1.__metadata("design:type", monaco_editor_service_1.MonacoEditorService)
79
+ ], NotebookCellEditorService.prototype, "monacoEditorService", void 0);
80
+ tslib_1.__decorate([
81
+ (0, inversify_1.postConstruct)(),
82
+ tslib_1.__metadata("design:type", Function),
83
+ tslib_1.__metadata("design:paramtypes", []),
84
+ tslib_1.__metadata("design:returntype", void 0)
85
+ ], NotebookCellEditorService.prototype, "init", null);
86
+ exports.NotebookCellEditorService = NotebookCellEditorService = tslib_1.__decorate([
87
+ (0, inversify_1.injectable)()
88
+ ], NotebookCellEditorService);
89
+ //# sourceMappingURL=notebook-cell-editor-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-cell-editor-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-cell-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,sCAA2C;AAC3C,4DAAiF;AAEjF,qFAA+E;AAC/E,yCAAuC;AACvC,2FAAsH;AAI/G,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAA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nB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,6BAA6B,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,kBAAkB,CAAC,MAA2B;QAC1C,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC;YAChC,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YAClE,IAAI,CAAC,mCAAmC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC;IAED,aAAa;QACT,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED,eAAe;;QACX,OAAO,MAAA,IAAI,CAAC,aAAa,EAAE,0CAAE,UAAU,EAAE,CAAC;IAC9C,CAAC;CACJ,CAAA;AA5DY,8DAAyB;AAGf;IADlB,IAAA,kBAAM,EAAC,4DAA2B,CAAC;sCACY,4DAA2B;8EAAC;AAGzD;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;sCACY,2CAAmB;sEAAC;AAalD;IADT,IAAA,yBAAa,GAAE;;;;qDAWf;oCA7BQ,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CA4DrC"}
@@ -0,0 +1,39 @@
1
+ import { CancellationToken, Command, Disposable, Emitter, Event, URI } from '@theia/core';
2
+ import { CellStatusbarAlignment } from '../../common';
3
+ import { ThemeColor } from '@theia/core/lib/common/theme';
4
+ import { AccessibilityInformation } from '@theia/core/lib/common/accessibility';
5
+ import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
6
+ export interface NotebookCellStatusBarItem {
7
+ readonly alignment: CellStatusbarAlignment;
8
+ readonly priority?: number;
9
+ readonly text: string;
10
+ readonly color?: string | ThemeColor;
11
+ readonly backgroundColor?: string | ThemeColor;
12
+ readonly tooltip?: string | MarkdownString;
13
+ readonly command?: string | (Command & {
14
+ arguments?: unknown[];
15
+ });
16
+ readonly accessibilityInformation?: AccessibilityInformation;
17
+ readonly opacity?: string;
18
+ readonly onlyShowWhenActive?: boolean;
19
+ }
20
+ export interface NotebookCellStatusBarItemList {
21
+ items: NotebookCellStatusBarItem[];
22
+ dispose?(): void;
23
+ }
24
+ export interface NotebookCellStatusBarItemProvider {
25
+ viewType: string;
26
+ onDidChangeStatusBarItems?: Event<void>;
27
+ provideCellStatusBarItems(uri: URI, index: number, token: CancellationToken): Promise<NotebookCellStatusBarItemList | undefined>;
28
+ }
29
+ export declare class NotebookCellStatusBarService implements Disposable {
30
+ protected readonly onDidChangeProvidersEmitter: Emitter<void>;
31
+ readonly onDidChangeProviders: Event<void>;
32
+ protected readonly onDidChangeItemsEmitter: Emitter<void>;
33
+ readonly onDidChangeItems: Event<void>;
34
+ protected readonly providers: NotebookCellStatusBarItemProvider[];
35
+ registerCellStatusBarItemProvider(provider: NotebookCellStatusBarItemProvider): Disposable;
36
+ getStatusBarItemsForCell(notebookUri: URI, cellIndex: number, viewType: string, token: CancellationToken): Promise<NotebookCellStatusBarItemList[]>;
37
+ dispose(): void;
38
+ }
39
+ //# sourceMappingURL=notebook-cell-status-bar-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-cell-status-bar-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-cell-status-bar-service.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,MAAM,WAAW,yB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,IAAI,CAAC,CAAsC;IAE5E,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,iCAAiC,EAAE,CAAM;IAEvE,iCAAiC,CAAC,QAAQ,EAAE,iCAAiC,GAAG,UAAU;IAgBpF,wBAAwB,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,6BAA6B,EAAE,CAAC;IAYzJ,OAAO,IAAI,IAAI;CAIlB"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.NotebookCellStatusBarService = void 0;
23
+ const tslib_1 = require("tslib");
24
+ const core_1 = require("@theia/core");
25
+ const inversify_1 = require("@theia/core/shared/inversify");
26
+ let NotebookCellStatusBarService = class NotebookCellStatusBarService {
27
+ constructor() {
28
+ this.onDidChangeProvidersEmitter = new core_1.Emitter();
29
+ this.onDidChangeProviders = this.onDidChangeProvidersEmitter.event;
30
+ this.onDidChangeItemsEmitter = new core_1.Emitter();
31
+ this.onDidChangeItems = this.onDidChangeItemsEmitter.event;
32
+ this.providers = [];
33
+ }
34
+ registerCellStatusBarItemProvider(provider) {
35
+ this.providers.push(provider);
36
+ let changeListener;
37
+ if (provider.onDidChangeStatusBarItems) {
38
+ changeListener = provider.onDidChangeStatusBarItems(() => this.onDidChangeItemsEmitter.fire());
39
+ }
40
+ this.onDidChangeProvidersEmitter.fire();
41
+ return core_1.Disposable.create(() => {
42
+ changeListener === null || changeListener === void 0 ? void 0 : changeListener.dispose();
43
+ const idx = this.providers.findIndex(p => p === provider);
44
+ this.providers.splice(idx, 1);
45
+ });
46
+ }
47
+ async getStatusBarItemsForCell(notebookUri, cellIndex, viewType, token) {
48
+ const providers = this.providers.filter(p => p.viewType === viewType || p.viewType === '*');
49
+ return Promise.all(providers.map(async (p) => {
50
+ var _a;
51
+ try {
52
+ return (_a = await p.provideCellStatusBarItems(notebookUri, cellIndex, token)) !== null && _a !== void 0 ? _a : { items: [] };
53
+ }
54
+ catch (e) {
55
+ console.error(e);
56
+ return { items: [] };
57
+ }
58
+ }));
59
+ }
60
+ dispose() {
61
+ this.onDidChangeItemsEmitter.dispose();
62
+ this.onDidChangeProvidersEmitter.dispose();
63
+ }
64
+ };
65
+ exports.NotebookCellStatusBarService = NotebookCellStatusBarService;
66
+ exports.NotebookCellStatusBarService = NotebookCellStatusBarService = tslib_1.__decorate([
67
+ (0, inversify_1.injectable)()
68
+ ], NotebookCellStatusBarService);
69
+ //# sourceMappingURL=notebook-cell-status-bar-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-cell-status-bar-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-cell-status-bar-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,g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KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC;QAC5F,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;;YACvC,IAAI,CAAC;gBACD,OAAO,MAAA,MAAM,CAAC,CAAC,yBAAyB,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,mCAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YAC7F,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACjB,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YACzB,CAAC;QACL,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IAED,OAAO;QACH,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,2BAA2B,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;CACJ,CAAA;AA1CY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA0CxC"}
@@ -0,0 +1,10 @@
1
+ import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
2
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
3
+ import { CellData } from '../../common';
4
+ export declare class NotebookClipboardService {
5
+ protected copiedCell: CellData | undefined;
6
+ protected readonly clipboardService: ClipboardService;
7
+ copyCell(cell: NotebookCellModel): void;
8
+ getCell(): CellData | undefined;
9
+ }
10
+ //# sourceMappingURL=notebook-clipboard-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-clipboard-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-clipboard-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,qBACa,wBAAwB;IAEjC,SAAS,CAAC,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IAG3C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI;IAQvC,OAAO,IAAI,QAAQ,GAAG,SAAS;CAIlC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.NotebookClipboardService = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const clipboard_service_1 = require("@theia/core/lib/browser/clipboard-service");
22
+ const core_1 = require("@theia/core");
23
+ let NotebookClipboardService = class NotebookClipboardService {
24
+ copyCell(cell) {
25
+ this.copiedCell = cell.getData();
26
+ if (core_1.environment.electron.is()) {
27
+ this.clipboardService.writeText(cell.text);
28
+ }
29
+ }
30
+ getCell() {
31
+ return this.copiedCell;
32
+ }
33
+ };
34
+ exports.NotebookClipboardService = NotebookClipboardService;
35
+ tslib_1.__decorate([
36
+ (0, inversify_1.inject)(clipboard_service_1.ClipboardService),
37
+ tslib_1.__metadata("design:type", Object)
38
+ ], NotebookClipboardService.prototype, "clipboardService", void 0);
39
+ exports.NotebookClipboardService = NotebookClipboardService = tslib_1.__decorate([
40
+ (0, inversify_1.injectable)()
41
+ ], NotebookClipboardService);
42
+ //# sourceMappingURL=notebook-clipboard-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-clipboard-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-clipboard-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,4DAAkE;AAClE,iFAA6E;AAE7E,sCAA0C;AAInC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAOjC,QAAQ,CAAC,IAAuB;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAEjC,IAAI,kBAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;YAC5B,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CAEJ,CAAA;AAnBY,4DAAwB;AAKd;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;kEAC6B;mCAL7C,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAmBpC"}
@@ -0,0 +1,28 @@
1
+ import { ContextKeyChangeEvent, ContextKeyService, ContextMatcher, ScopedValueStore } from '@theia/core/lib/browser/context-key-service';
2
+ import { DisposableCollection } from '@theia/core';
3
+ import { NotebookKernelService } from './notebook-kernel-service';
4
+ import { NotebookEditorWidget } from '../notebook-editor-widget';
5
+ import { NotebookCellModel } from '../view-model/notebook-cell-model';
6
+ import { NotebookExecutionStateService } from './notebook-execution-state-service';
7
+ import { NotebookViewModel } from '../view-model/notebook-view-model';
8
+ export declare class NotebookContextManager {
9
+ protected contextKeyService: ContextKeyService;
10
+ protected readonly notebookKernelService: NotebookKernelService;
11
+ protected readonly executionStateService: NotebookExecutionStateService;
12
+ protected readonly toDispose: DisposableCollection;
13
+ protected _context?: HTMLElement;
14
+ scopedStore: ScopedValueStore;
15
+ get context(): HTMLElement | undefined;
16
+ protected cellContexts: Map<number, Record<string, unknown>>;
17
+ protected notebookViewModel: NotebookViewModel;
18
+ init(widget: NotebookEditorWidget): void;
19
+ protected cellDisposables: DisposableCollection;
20
+ selectedCellChanged(cell: NotebookCellModel | undefined): void;
21
+ protected setCellContext(cellHandle: number, key: string, value: unknown): void;
22
+ getCellContext(cellHandle: number): ContextMatcher;
23
+ changeCellFocus(focus: boolean): void;
24
+ changeCellListFocus(focus: boolean): void;
25
+ createContextKeyChangedEvent(affectedKeys: string[]): ContextKeyChangeEvent;
26
+ dispose(): void;
27
+ }
28
+ //# sourceMappingURL=notebook-context-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-context-manager.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-context-manager.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACzI,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AASlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,qBACa,sBAAsB;IACJ,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGhE,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;IAExE,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;IAE1D,SAAS,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEjC,WAAW,EAAE,gBAAgB,CAAC;IAE9B,IAAI,OAAO,IAAI,WAAW,GAAG,SAAS,CAErC;IAED,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAa;IAEzE,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAiDxC,SAAS,CAAC,eAAe,uBAA8B;IAEvD,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,IAAI;IAkB9D,SAAS,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAU/E,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAIlD,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAIrC,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAIzC,4BAA4B,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAI3E,OAAO,IAAI,IAAI;CAGlB"}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.NotebookContextManager = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
22
+ const core_1 = require("@theia/core");
23
+ const notebook_kernel_service_1 = require("./notebook-kernel-service");
24
+ const notebook_context_keys_1 = require("../contributions/notebook-context-keys");
25
+ const common_1 = require("../../common");
26
+ const notebook_execution_state_service_1 = require("./notebook-execution-state-service");
27
+ let NotebookContextManager = class NotebookContextManager {
28
+ constructor() {
29
+ this.toDispose = new core_1.DisposableCollection();
30
+ this.cellContexts = new Map();
31
+ this.cellDisposables = new core_1.DisposableCollection();
32
+ }
33
+ get context() {
34
+ return this._context;
35
+ }
36
+ init(widget) {
37
+ var _a, _b;
38
+ this._context = widget.node;
39
+ this.scopedStore = this.contextKeyService.createScoped(widget.node);
40
+ this.toDispose.dispose();
41
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_VIEW_TYPE, widget === null || widget === void 0 ? void 0 : widget.notebookType);
42
+ this.notebookViewModel = widget.viewModel;
43
+ // Kernel related keys
44
+ const kernel = (widget === null || widget === void 0 ? void 0 : widget.model) ? this.notebookKernelService.getSelectedNotebookKernel(widget.model) : undefined;
45
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_KERNEL_SELECTED, !!kernel);
46
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_KERNEL, kernel === null || kernel === void 0 ? void 0 : kernel.id);
47
+ this.toDispose.push(this.notebookKernelService.onDidChangeSelectedKernel(e => {
48
+ var _a;
49
+ if (e.notebook.toString() === ((_a = widget === null || widget === void 0 ? void 0 : widget.getResourceUri()) === null || _a === void 0 ? void 0 : _a.toString())) {
50
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_KERNEL_SELECTED, !!e.newKernel);
51
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_KERNEL, e.newKernel);
52
+ }
53
+ }));
54
+ (_a = widget.model) === null || _a === void 0 ? void 0 : _a.onDidChangeContent(events => {
55
+ var _a;
56
+ if (events.some(e => e.kind === common_1.NotebookCellsChangeType.ModelChange || e.kind === common_1.NotebookCellsChangeType.Output)) {
57
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_HAS_OUTPUTS, (_a = widget.model) === null || _a === void 0 ? void 0 : _a.cells.some(cell => cell.outputs.length > 0));
58
+ }
59
+ });
60
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_HAS_OUTPUTS, !!((_b = widget.model) === null || _b === void 0 ? void 0 : _b.cells.find(cell => cell.outputs.length > 0)));
61
+ // Cell Selection related keys
62
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_FOCUSED, !!widget.viewModel.selectedCell);
63
+ this.selectedCellChanged(widget.viewModel.selectedCell);
64
+ widget.viewModel.onDidChangeSelectedCell(e => {
65
+ this.selectedCellChanged(e.cell);
66
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_FOCUSED, !!e);
67
+ });
68
+ this.toDispose.push(this.executionStateService.onDidChangeExecution(e => {
69
+ var _a, _b, _c;
70
+ if (e.notebook.toString() === ((_a = widget.model) === null || _a === void 0 ? void 0 : _a.uri.toString())) {
71
+ this.setCellContext(e.cellHandle, notebook_context_keys_1.NOTEBOOK_CELL_EXECUTING, !!e.changed);
72
+ this.setCellContext(e.cellHandle, notebook_context_keys_1.NOTEBOOK_CELL_EXECUTION_STATE, (_c = (_b = e.changed) === null || _b === void 0 ? void 0 : _b.state) !== null && _c !== void 0 ? _c : 'idle');
73
+ }
74
+ }));
75
+ widget.onDidChangeOutputInputFocus(focus => {
76
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_OUTPUT_INPUT_FOCUSED, focus);
77
+ });
78
+ }
79
+ selectedCellChanged(cell) {
80
+ this.cellDisposables.dispose();
81
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_TYPE, cell ? cell.cellKind === common_1.CellKind.Code ? 'code' : 'markdown' : undefined);
82
+ if (cell) {
83
+ const cellViewModel = this.notebookViewModel.cellViewModels.get(cell.handle);
84
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, cellViewModel === null || cellViewModel === void 0 ? void 0 : cellViewModel.editing);
85
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_EDITABLE, cell.cellKind === common_1.CellKind.Markup && !(cellViewModel === null || cellViewModel === void 0 ? void 0 : cellViewModel.editing));
86
+ if (cellViewModel) {
87
+ this.cellDisposables.push(cellViewModel.onDidRequestCellEditChange(cellEdit => {
88
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, cellEdit);
89
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_EDITABLE, cell.cellKind === common_1.CellKind.Markup && !cellEdit);
90
+ }));
91
+ }
92
+ }
93
+ }
94
+ setCellContext(cellHandle, key, value) {
95
+ let cellContext = this.cellContexts.get(cellHandle);
96
+ if (!cellContext) {
97
+ cellContext = {};
98
+ this.cellContexts.set(cellHandle, cellContext);
99
+ }
100
+ cellContext[key] = value;
101
+ }
102
+ getCellContext(cellHandle) {
103
+ var _a;
104
+ return this.contextKeyService.createOverlay(Object.entries((_a = this.cellContexts.get(cellHandle)) !== null && _a !== void 0 ? _a : {}));
105
+ }
106
+ changeCellFocus(focus) {
107
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_FOCUSED, focus);
108
+ }
109
+ changeCellListFocus(focus) {
110
+ this.scopedStore.setContext(notebook_context_keys_1.NOTEBOOK_CELL_LIST_FOCUSED, focus);
111
+ }
112
+ createContextKeyChangedEvent(affectedKeys) {
113
+ return { affects: keys => affectedKeys.some(key => keys.has(key)) };
114
+ }
115
+ dispose() {
116
+ this.toDispose.dispose();
117
+ }
118
+ };
119
+ exports.NotebookContextManager = NotebookContextManager;
120
+ tslib_1.__decorate([
121
+ (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
122
+ tslib_1.__metadata("design:type", Object)
123
+ ], NotebookContextManager.prototype, "contextKeyService", void 0);
124
+ tslib_1.__decorate([
125
+ (0, inversify_1.inject)(notebook_kernel_service_1.NotebookKernelService),
126
+ tslib_1.__metadata("design:type", notebook_kernel_service_1.NotebookKernelService)
127
+ ], NotebookContextManager.prototype, "notebookKernelService", void 0);
128
+ tslib_1.__decorate([
129
+ (0, inversify_1.inject)(notebook_execution_state_service_1.NotebookExecutionStateService),
130
+ tslib_1.__metadata("design:type", notebook_execution_state_service_1.NotebookExecutionStateService)
131
+ ], NotebookContextManager.prototype, "executionStateService", void 0);
132
+ exports.NotebookContextManager = NotebookContextManager = tslib_1.__decorate([
133
+ (0, inversify_1.injectable)()
134
+ ], NotebookContextManager);
135
+ //# sourceMappingURL=notebook-context-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-context-manager.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-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,qFAAyI;AACzI,sCAAmD;AACnD,uEAAkE;AAClE,kFAOgD;AAGhD,yCAAiE;AACjE,yFAAmF;AAI5E,IAAM,sBAAsB,GAA5B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,GAAG,CAAC,UAAU,CAAC,mCAAI,EAAE,CAAC,CAAC,CAAC;IACzG,CAAC;IAED,eAAe,CAAC,KAAc;QAC1B,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,6CAAqB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAED,mBAAmB,CAAC,KAAc;QAC9B,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,kDAA0B,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,4BAA4B,CAAC,YAAsB;QAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ,CAAA;AAzHY,wDAAsB;AACM;IAApC,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;iEAAgD;AAGvD;IADlB,IAAA,kBAAM,EAAC,+CAAqB,CAAC;sCACY,+CAAqB;qEAAC;AAG7C;IADlB,IAAA,kBAAM,EAAC,gEAA6B,CAAC;sCACI,gEAA6B;qEAAC;iCAP/D,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAyHlC"}
@@ -0,0 +1,27 @@
1
+ import { Emitter } from '@theia/core';
2
+ import { ApplicationShell } from '@theia/core/lib/browser';
3
+ import { NotebookEditorWidget } from '../notebook-editor-widget';
4
+ import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
5
+ export declare class NotebookEditorWidgetService {
6
+ protected applicationShell: ApplicationShell;
7
+ protected contextKeyService: ContextKeyService;
8
+ protected readonly notebookEditors: Map<string, NotebookEditorWidget>;
9
+ protected readonly onNotebookEditorAddEmitter: Emitter<NotebookEditorWidget>;
10
+ protected readonly onNotebookEditorRemoveEmitter: Emitter<NotebookEditorWidget>;
11
+ readonly onDidAddNotebookEditor: import("@theia/core").Event<NotebookEditorWidget>;
12
+ readonly onDidRemoveNotebookEditor: import("@theia/core").Event<NotebookEditorWidget>;
13
+ protected readonly onDidChangeFocusedEditorEmitter: Emitter<NotebookEditorWidget | undefined>;
14
+ readonly onDidChangeFocusedEditor: import("@theia/core").Event<NotebookEditorWidget | undefined>;
15
+ protected readonly onDidChangeCurrentEditorEmitter: Emitter<NotebookEditorWidget | undefined>;
16
+ readonly onDidChangeCurrentEditor: import("@theia/core").Event<NotebookEditorWidget | undefined>;
17
+ focusedEditor?: NotebookEditorWidget;
18
+ currentEditor?: NotebookEditorWidget;
19
+ protected init(): void;
20
+ addNotebookEditor(editor: NotebookEditorWidget): void;
21
+ removeNotebookEditor(editor: NotebookEditorWidget): void;
22
+ getNotebookEditor(editorId: string): NotebookEditorWidget | undefined;
23
+ getNotebookEditors(): readonly NotebookEditorWidget[];
24
+ notebookEditorFocusChanged(editor: NotebookEditorWidget, focus: boolean): void;
25
+ currentNotebookEditorChanged(newEditor: unknown): void;
26
+ }
27
+ //# sourceMappingURL=notebook-editor-widget-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebook-editor-widget-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-editor-widget-service.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAGhF,qBACa,2BAA2B;IAGpC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAG7C,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,QAAQ,CAAC,eAAe,oCAA2C;IAE7E,SAAS,CAAC,QAAQ,CAAC,0BAA0B,gCAAuC;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