@theia/notebook 1.67.0-next.56 → 1.67.0-next.59
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.
- package/lib/browser/contributions/cell-operations.d.ts +8 -0
- package/lib/browser/contributions/cell-operations.d.ts.map +1 -0
- package/lib/browser/contributions/cell-operations.js +45 -0
- package/lib/browser/contributions/cell-operations.js.map +1 -0
- package/lib/browser/contributions/notebook-actions-contribution.d.ts +48 -0
- package/lib/browser/contributions/notebook-actions-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-actions-contribution.js +344 -0
- package/lib/browser/contributions/notebook-actions-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts +66 -0
- package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-cell-actions-contribution.js +526 -0
- package/lib/browser/contributions/notebook-cell-actions-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-color-contribution.d.ts +6 -0
- package/lib/browser/contributions/notebook-color-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-color-contribution.js +247 -0
- package/lib/browser/contributions/notebook-color-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-context-keys.d.ts +44 -0
- package/lib/browser/contributions/notebook-context-keys.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-context-keys.js +108 -0
- package/lib/browser/contributions/notebook-context-keys.js.map +1 -0
- package/lib/browser/contributions/notebook-label-provider-contribution.d.ts +19 -0
- package/lib/browser/contributions/notebook-label-provider-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-label-provider-contribution.js +86 -0
- package/lib/browser/contributions/notebook-label-provider-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-outline-contribution.d.ts +29 -0
- package/lib/browser/contributions/notebook-outline-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-outline-contribution.js +115 -0
- package/lib/browser/contributions/notebook-outline-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-output-action-contribution.d.ts +16 -0
- package/lib/browser/contributions/notebook-output-action-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-output-action-contribution.js +83 -0
- package/lib/browser/contributions/notebook-output-action-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-status-bar-contribution.d.ts +12 -0
- package/lib/browser/contributions/notebook-status-bar-contribution.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-status-bar-contribution.js +61 -0
- package/lib/browser/contributions/notebook-status-bar-contribution.js.map +1 -0
- package/lib/browser/contributions/notebook-undo-redo-handler.d.ts +10 -0
- package/lib/browser/contributions/notebook-undo-redo-handler.d.ts.map +1 -0
- package/lib/browser/contributions/notebook-undo-redo-handler.js +49 -0
- package/lib/browser/contributions/notebook-undo-redo-handler.js.map +1 -0
- package/lib/browser/index.d.ts +14 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +32 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/notebook-cell-open-handler.d.ts +10 -0
- package/lib/browser/notebook-cell-open-handler.d.ts.map +1 -0
- package/lib/browser/notebook-cell-open-handler.js +52 -0
- package/lib/browser/notebook-cell-open-handler.js.map +1 -0
- package/lib/browser/notebook-cell-resource-resolver.d.ts +26 -0
- package/lib/browser/notebook-cell-resource-resolver.d.ts.map +1 -0
- package/lib/browser/notebook-cell-resource-resolver.js +109 -0
- package/lib/browser/notebook-cell-resource-resolver.js.map +1 -0
- package/lib/browser/notebook-editor-split-contribution.d.ts +14 -0
- package/lib/browser/notebook-editor-split-contribution.d.ts.map +1 -0
- package/lib/browser/notebook-editor-split-contribution.js +51 -0
- package/lib/browser/notebook-editor-split-contribution.js.map +1 -0
- package/lib/browser/notebook-editor-widget-factory.d.ts +20 -0
- package/lib/browser/notebook-editor-widget-factory.d.ts.map +1 -0
- package/lib/browser/notebook-editor-widget-factory.js +101 -0
- package/lib/browser/notebook-editor-widget-factory.js.map +1 -0
- package/lib/browser/notebook-editor-widget.d.ts +102 -0
- package/lib/browser/notebook-editor-widget.d.ts.map +1 -0
- package/lib/browser/notebook-editor-widget.js +336 -0
- package/lib/browser/notebook-editor-widget.js.map +1 -0
- package/lib/browser/notebook-frontend-module.d.ts +5 -0
- package/lib/browser/notebook-frontend-module.d.ts.map +1 -0
- package/lib/browser/notebook-frontend-module.js +116 -0
- package/lib/browser/notebook-frontend-module.js.map +1 -0
- package/lib/browser/notebook-open-handler.d.ts +29 -0
- package/lib/browser/notebook-open-handler.d.ts.map +1 -0
- package/lib/browser/notebook-open-handler.js +119 -0
- package/lib/browser/notebook-open-handler.js.map +1 -0
- package/lib/browser/notebook-output-utils.d.ts +13 -0
- package/lib/browser/notebook-output-utils.d.ts.map +1 -0
- package/lib/browser/notebook-output-utils.js +112 -0
- package/lib/browser/notebook-output-utils.js.map +1 -0
- package/lib/browser/notebook-renderer-registry.d.ts +25 -0
- package/lib/browser/notebook-renderer-registry.d.ts.map +1 -0
- package/lib/browser/notebook-renderer-registry.js +72 -0
- package/lib/browser/notebook-renderer-registry.js.map +1 -0
- package/lib/browser/notebook-type-registry.d.ts +12 -0
- package/lib/browser/notebook-type-registry.d.ts.map +1 -0
- package/lib/browser/notebook-type-registry.js +60 -0
- package/lib/browser/notebook-type-registry.js.map +1 -0
- package/lib/browser/notebook-types.d.ts +131 -0
- package/lib/browser/notebook-types.d.ts.map +1 -0
- package/lib/browser/notebook-types.js +28 -0
- package/lib/browser/notebook-types.js.map +1 -0
- package/lib/browser/renderers/cell-output-webview.d.ts +26 -0
- package/lib/browser/renderers/cell-output-webview.d.ts.map +1 -0
- package/lib/browser/renderers/cell-output-webview.js +21 -0
- package/lib/browser/renderers/cell-output-webview.js.map +1 -0
- package/lib/browser/service/notebook-cell-editor-service.d.ts +23 -0
- package/lib/browser/service/notebook-cell-editor-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-cell-editor-service.js +89 -0
- package/lib/browser/service/notebook-cell-editor-service.js.map +1 -0
- package/lib/browser/service/notebook-cell-status-bar-service.d.ts +39 -0
- package/lib/browser/service/notebook-cell-status-bar-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-cell-status-bar-service.js +69 -0
- package/lib/browser/service/notebook-cell-status-bar-service.js.map +1 -0
- package/lib/browser/service/notebook-clipboard-service.d.ts +10 -0
- package/lib/browser/service/notebook-clipboard-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-clipboard-service.js +42 -0
- package/lib/browser/service/notebook-clipboard-service.js.map +1 -0
- package/lib/browser/service/notebook-context-manager.d.ts +28 -0
- package/lib/browser/service/notebook-context-manager.d.ts.map +1 -0
- package/lib/browser/service/notebook-context-manager.js +135 -0
- package/lib/browser/service/notebook-context-manager.js.map +1 -0
- package/lib/browser/service/notebook-editor-widget-service.d.ts +27 -0
- package/lib/browser/service/notebook-editor-widget-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-editor-widget-service.js +124 -0
- package/lib/browser/service/notebook-editor-widget-service.js.map +1 -0
- package/lib/browser/service/notebook-execution-service.d.ts +25 -0
- package/lib/browser/service/notebook-execution-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-execution-service.js +150 -0
- package/lib/browser/service/notebook-execution-service.js.map +1 -0
- package/lib/browser/service/notebook-execution-state-service.d.ts +78 -0
- package/lib/browser/service/notebook-execution-state-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-execution-state-service.js +247 -0
- package/lib/browser/service/notebook-execution-state-service.js.map +1 -0
- package/lib/browser/service/notebook-kernel-history-service.d.ts +28 -0
- package/lib/browser/service/notebook-kernel-history-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-kernel-history-service.js +116 -0
- package/lib/browser/service/notebook-kernel-history-service.js.map +1 -0
- package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts +61 -0
- package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-kernel-quick-pick-service.js +425 -0
- package/lib/browser/service/notebook-kernel-quick-pick-service.js.map +1 -0
- package/lib/browser/service/notebook-kernel-service.d.ts +125 -0
- package/lib/browser/service/notebook-kernel-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-kernel-service.js +268 -0
- package/lib/browser/service/notebook-kernel-service.js.map +1 -0
- package/lib/browser/service/notebook-model-resolver-service.d.ts +28 -0
- package/lib/browser/service/notebook-model-resolver-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-model-resolver-service.js +157 -0
- package/lib/browser/service/notebook-model-resolver-service.js.map +1 -0
- package/lib/browser/service/notebook-monaco-text-model-service.d.ts +21 -0
- package/lib/browser/service/notebook-monaco-text-model-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-monaco-text-model-service.js +73 -0
- package/lib/browser/service/notebook-monaco-text-model-service.js.map +1 -0
- package/lib/browser/service/notebook-options.d.ts +30 -0
- package/lib/browser/service/notebook-options.d.ts.map +1 -0
- package/lib/browser/service/notebook-options.js +130 -0
- package/lib/browser/service/notebook-options.js.map +1 -0
- package/lib/browser/service/notebook-renderer-messaging-service.d.ts +35 -0
- package/lib/browser/service/notebook-renderer-messaging-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-renderer-messaging-service.js +100 -0
- package/lib/browser/service/notebook-renderer-messaging-service.js.map +1 -0
- package/lib/browser/service/notebook-service.d.ts +68 -0
- package/lib/browser/service/notebook-service.d.ts.map +1 -0
- package/lib/browser/service/notebook-service.js +184 -0
- package/lib/browser/service/notebook-service.js.map +1 -0
- package/lib/browser/view/notebook-cell-editor.d.ts +46 -0
- package/lib/browser/view/notebook-cell-editor.d.ts.map +1 -0
- package/lib/browser/view/notebook-cell-editor.js +271 -0
- package/lib/browser/view/notebook-cell-editor.js.map +1 -0
- package/lib/browser/view/notebook-cell-list-view.d.ts +58 -0
- package/lib/browser/view/notebook-cell-list-view.d.ts.map +1 -0
- package/lib/browser/view/notebook-cell-list-view.js +225 -0
- package/lib/browser/view/notebook-cell-list-view.js.map +1 -0
- package/lib/browser/view/notebook-cell-toolbar-factory.d.ts +33 -0
- package/lib/browser/view/notebook-cell-toolbar-factory.d.ts.map +1 -0
- package/lib/browser/view/notebook-cell-toolbar-factory.js +110 -0
- package/lib/browser/view/notebook-cell-toolbar-factory.js.map +1 -0
- package/lib/browser/view/notebook-cell-toolbar.d.ts +25 -0
- package/lib/browser/view/notebook-cell-toolbar.d.ts.map +1 -0
- package/lib/browser/view/notebook-cell-toolbar.js +51 -0
- package/lib/browser/view/notebook-cell-toolbar.js.map +1 -0
- package/lib/browser/view/notebook-code-cell-view.d.ts +93 -0
- package/lib/browser/view/notebook-code-cell-view.d.ts.map +1 -0
- package/lib/browser/view/notebook-code-cell-view.js +338 -0
- package/lib/browser/view/notebook-code-cell-view.js.map +1 -0
- package/lib/browser/view/notebook-find-widget.d.ts +63 -0
- package/lib/browser/view/notebook-find-widget.d.ts.map +1 -0
- package/lib/browser/view/notebook-find-widget.js +225 -0
- package/lib/browser/view/notebook-find-widget.js.map +1 -0
- package/lib/browser/view/notebook-main-toolbar.d.ts +53 -0
- package/lib/browser/view/notebook-main-toolbar.d.ts.map +1 -0
- package/lib/browser/view/notebook-main-toolbar.js +184 -0
- package/lib/browser/view/notebook-main-toolbar.js.map +1 -0
- package/lib/browser/view/notebook-markdown-cell-view.d.ts +28 -0
- package/lib/browser/view/notebook-markdown-cell-view.d.ts.map +1 -0
- package/lib/browser/view/notebook-markdown-cell-view.js +216 -0
- package/lib/browser/view/notebook-markdown-cell-view.js.map +1 -0
- package/lib/browser/view/notebook-viewport-service.d.ts +17 -0
- package/lib/browser/view/notebook-viewport-service.d.ts.map +1 -0
- package/lib/browser/view/notebook-viewport-service.js +61 -0
- package/lib/browser/view/notebook-viewport-service.js.map +1 -0
- package/lib/browser/view-model/notebook-cell-model.d.ts +137 -0
- package/lib/browser/view-model/notebook-cell-model.d.ts.map +1 -0
- package/lib/browser/view-model/notebook-cell-model.js +367 -0
- package/lib/browser/view-model/notebook-cell-model.js.map +1 -0
- package/lib/browser/view-model/notebook-cell-output-model.d.ts +17 -0
- package/lib/browser/view-model/notebook-cell-output-model.d.ts.map +1 -0
- package/lib/browser/view-model/notebook-cell-output-model.js +87 -0
- package/lib/browser/view-model/notebook-cell-output-model.js.map +1 -0
- package/lib/browser/view-model/notebook-model.d.ts +85 -0
- package/lib/browser/view-model/notebook-model.d.ts.map +1 -0
- package/lib/browser/view-model/notebook-model.js +446 -0
- package/lib/browser/view-model/notebook-model.js.map +1 -0
- package/lib/browser/view-model/notebook-view-model.d.ts +40 -0
- package/lib/browser/view-model/notebook-view-model.d.ts.map +1 -0
- package/lib/browser/view-model/notebook-view-model.js +120 -0
- package/lib/browser/view-model/notebook-view-model.js.map +1 -0
- package/lib/common/index.d.ts +3 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +21 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/notebook-common.d.ts +227 -0
- package/lib/common/notebook-common.d.ts.map +1 -0
- package/lib/common/notebook-common.js +151 -0
- package/lib/common/notebook-common.js.map +1 -0
- package/lib/common/notebook-preferences.d.ts +15 -0
- package/lib/common/notebook-preferences.d.ts.map +1 -0
- package/lib/common/notebook-preferences.js +89 -0
- package/lib/common/notebook-preferences.js.map +1 -0
- package/lib/common/notebook-protocol.d.ts +21 -0
- package/lib/common/notebook-protocol.d.ts.map +1 -0
- package/lib/common/notebook-protocol.js +18 -0
- package/lib/common/notebook-protocol.js.map +1 -0
- package/lib/common/notebook-range.d.ts +14 -0
- package/lib/common/notebook-range.d.ts.map +1 -0
- package/lib/common/notebook-range.js +18 -0
- package/lib/common/notebook-range.js.map +1 -0
- package/lib/node/notebook-backend-module.d.ts +4 -0
- package/lib/node/notebook-backend-module.d.ts.map +1 -0
- package/lib/node/notebook-backend-module.js +23 -0
- package/lib/node/notebook-backend-module.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,115 @@
|
|
|
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.NotebookOutlineContribution = exports.NotebookCellOutlineNode = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const notebook_editor_widget_service_1 = require("../service/notebook-editor-widget-service");
|
|
23
|
+
const outline_view_service_1 = require("@theia/outline-view/lib/browser/outline-view-service");
|
|
24
|
+
const outline_view_widget_1 = require("@theia/outline-view/lib/browser/outline-view-widget");
|
|
25
|
+
const core_1 = require("@theia/core");
|
|
26
|
+
const common_1 = require("../../common");
|
|
27
|
+
const notebook_service_1 = require("../service/notebook-service");
|
|
28
|
+
var NotebookCellOutlineNode;
|
|
29
|
+
(function (NotebookCellOutlineNode) {
|
|
30
|
+
function is(element) {
|
|
31
|
+
return browser_1.TreeNode.is(element)
|
|
32
|
+
&& outline_view_widget_1.OutlineSymbolInformationNode.is(element)
|
|
33
|
+
&& (0, core_1.isObject)(element)
|
|
34
|
+
&& element.uri instanceof core_1.URI
|
|
35
|
+
&& element.uri.scheme === common_1.CellUri.cellUriScheme;
|
|
36
|
+
}
|
|
37
|
+
NotebookCellOutlineNode.is = is;
|
|
38
|
+
})(NotebookCellOutlineNode || (exports.NotebookCellOutlineNode = NotebookCellOutlineNode = {}));
|
|
39
|
+
let NotebookOutlineContribution = class NotebookOutlineContribution {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.editorListeners = new core_1.DisposableCollection();
|
|
42
|
+
this.editorModelListeners = new core_1.DisposableCollection();
|
|
43
|
+
}
|
|
44
|
+
onStart() {
|
|
45
|
+
this.notebookEditorWidgetService.onDidChangeFocusedEditor(editor => this.updateOutline(editor));
|
|
46
|
+
this.outlineViewService.onDidSelect(node => this.selectCell(node));
|
|
47
|
+
this.outlineViewService.onDidTapNode(node => this.selectCell(node));
|
|
48
|
+
}
|
|
49
|
+
async updateOutline(editor) {
|
|
50
|
+
if (editor && !editor.isDisposed) {
|
|
51
|
+
await editor.ready;
|
|
52
|
+
this.currentEditor = editor;
|
|
53
|
+
this.editorListeners.dispose();
|
|
54
|
+
this.editorListeners.push(editor.onDidChangeVisibility(() => {
|
|
55
|
+
if (this.currentEditor === editor && !editor.isVisible) {
|
|
56
|
+
this.outlineViewService.publish([]);
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
if (editor.model) {
|
|
60
|
+
this.editorModelListeners.dispose();
|
|
61
|
+
this.editorModelListeners.push(editor.viewModel.onDidChangeSelectedCell(() => {
|
|
62
|
+
if (editor === this.currentEditor) {
|
|
63
|
+
this.updateOutline(editor);
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
const roots = editor && editor.model && await this.createRoots(editor.model, editor.viewModel);
|
|
67
|
+
this.outlineViewService.publish(roots || []);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async createRoots(model, viewModel) {
|
|
72
|
+
return model.cells.map(cell => ({
|
|
73
|
+
id: cell.uri.toString(),
|
|
74
|
+
iconClass: cell.cellKind === common_1.CellKind.Markup ? (0, browser_1.codicon)('markdown') : (0, browser_1.codicon)('code'),
|
|
75
|
+
parent: undefined,
|
|
76
|
+
children: [],
|
|
77
|
+
selected: viewModel.selectedCell === cell,
|
|
78
|
+
expanded: false,
|
|
79
|
+
uri: cell.uri,
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
selectCell(node) {
|
|
83
|
+
var _a;
|
|
84
|
+
if (NotebookCellOutlineNode.is(node)) {
|
|
85
|
+
const parsed = common_1.CellUri.parse(node.uri);
|
|
86
|
+
const model = parsed && this.notebookService.getNotebookEditorModel(parsed.notebook);
|
|
87
|
+
const viewModel = (_a = this.currentEditor) === null || _a === void 0 ? void 0 : _a.viewModel;
|
|
88
|
+
const cell = model === null || model === void 0 ? void 0 : model.cells.find(c => c.handle === (parsed === null || parsed === void 0 ? void 0 : parsed.handle));
|
|
89
|
+
if (model && cell) {
|
|
90
|
+
viewModel === null || viewModel === void 0 ? void 0 : viewModel.setSelectedCell(cell);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.NotebookOutlineContribution = NotebookOutlineContribution;
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, inversify_1.inject)(notebook_editor_widget_service_1.NotebookEditorWidgetService),
|
|
98
|
+
tslib_1.__metadata("design:type", notebook_editor_widget_service_1.NotebookEditorWidgetService)
|
|
99
|
+
], NotebookOutlineContribution.prototype, "notebookEditorWidgetService", void 0);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, inversify_1.inject)(outline_view_service_1.OutlineViewService),
|
|
102
|
+
tslib_1.__metadata("design:type", outline_view_service_1.OutlineViewService)
|
|
103
|
+
], NotebookOutlineContribution.prototype, "outlineViewService", void 0);
|
|
104
|
+
tslib_1.__decorate([
|
|
105
|
+
(0, inversify_1.inject)(browser_1.LabelProvider),
|
|
106
|
+
tslib_1.__metadata("design:type", browser_1.LabelProvider)
|
|
107
|
+
], NotebookOutlineContribution.prototype, "labelProvider", void 0);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, inversify_1.inject)(notebook_service_1.NotebookService),
|
|
110
|
+
tslib_1.__metadata("design:type", notebook_service_1.NotebookService)
|
|
111
|
+
], NotebookOutlineContribution.prototype, "notebookService", void 0);
|
|
112
|
+
exports.NotebookOutlineContribution = NotebookOutlineContribution = tslib_1.__decorate([
|
|
113
|
+
(0, inversify_1.injectable)()
|
|
114
|
+
], NotebookOutlineContribution);
|
|
115
|
+
//# sourceMappingURL=notebook-outline-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-outline-contribution.js","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-outline-contribution.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,qDAA4G;AAC5G,8FAAwF;AACxF,+FAA0F;AAE1F,6FAAmG;AAEnG,sCAAkE;AAClE,yCAAiD;AACjD,kEAA8D;AAM9D,IAAiB,uBAAuB,CAQvC;AARD,WAAiB,uBAAuB;IACpC,SAAgB,EAAE,CAAC,OAAe;QAC9B,OAAO,kBAAQ,CAAC,EAAE,CAAC,OAAO,CAAC;eACpB,kDAA4B,CAAC,EAAE,CAAC,OAAO,CAAC;eACxC,IAAA,eAAQ,EAA0B,OAAO,CAAC;eAC1C,OAAO,CAAC,GAAG,YAAY,UAAG;eAC1B,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,gBAAO,CAAC,aAAa,CAAC;IACxD,CAAC;IANe,0BAAE,KAMjB,CAAA;AACL,CAAC,EARgB,uBAAuB,uCAAvB,uBAAuB,QAQvC;AAGM,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAAjC;QAgBO,oBAAe,GAAyB,IAAI,2BAAoB,EAAE,CAAC;QACnE,yBAAoB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AAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,MAAK,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,CAAC,CAAC;YACjE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAChB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YACrC,CAAC;QACL,CAAC;IACL,CAAC;CAEJ,CAAA;AAzEY,kEAA2B;AAGjB;IADlB,IAAA,kBAAM,EAAC,4DAA2B,CAAC;sCACY,4DAA2B;gFAAC;AAGzD;IADlB,IAAA,kBAAM,EAAC,yCAAkB,CAAC;sCACY,yCAAkB;uEAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,uBAAa,CAAC;sCACY,uBAAa;kEAAC;AAG7B;IADlB,IAAA,kBAAM,EAAC,kCAAe,CAAC;sCACY,kCAAe;oEAAC;sCAZ3C,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAyEvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command, CommandContribution, CommandRegistry } from '@theia/core';
|
|
2
|
+
import { NotebookEditorWidgetService } from '../service/notebook-editor-widget-service';
|
|
3
|
+
import { CellOutput } from '../../common';
|
|
4
|
+
import { NotebookCellModel } from '../view-model/notebook-cell-model';
|
|
5
|
+
import { EditorManager } from '@theia/editor/lib/browser';
|
|
6
|
+
export declare namespace NotebookOutputCommands {
|
|
7
|
+
const ENABLE_SCROLLING: Command;
|
|
8
|
+
const OPEN_LARGE_OUTPUT: Command;
|
|
9
|
+
}
|
|
10
|
+
export declare class NotebookOutputActionContribution implements CommandContribution {
|
|
11
|
+
protected readonly notebookEditorService: NotebookEditorWidgetService;
|
|
12
|
+
protected readonly editorManager: EditorManager;
|
|
13
|
+
registerCommands(commands: CommandRegistry): void;
|
|
14
|
+
protected findOutputAndCell(output: string): [NotebookCellModel, CellOutput] | undefined;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=notebook-output-action-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-output-action-contribution.d.ts","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-output-action-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,UAAU,EAAW,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,gBAAgB,EAAE,OAE9B,CAAC;IACK,MAAM,iBAAiB,EAAE,OAE/B,CAAC;CACL;AAED,qBACa,gCAAiC,YAAW,mBAAmB;IAGxE,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,2BAA2B,CAAC;IAGtE,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEhD,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAqBjD,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,SAAS;CAiB3F"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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.NotebookOutputActionContribution = exports.NotebookOutputCommands = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const notebook_editor_widget_service_1 = require("../service/notebook-editor-widget-service");
|
|
22
|
+
const common_1 = require("../../common");
|
|
23
|
+
const browser_1 = require("@theia/editor/lib/browser");
|
|
24
|
+
var NotebookOutputCommands;
|
|
25
|
+
(function (NotebookOutputCommands) {
|
|
26
|
+
NotebookOutputCommands.ENABLE_SCROLLING = {
|
|
27
|
+
id: 'cellOutput.enableScrolling',
|
|
28
|
+
};
|
|
29
|
+
NotebookOutputCommands.OPEN_LARGE_OUTPUT = {
|
|
30
|
+
id: 'workbench.action.openLargeOutput'
|
|
31
|
+
};
|
|
32
|
+
})(NotebookOutputCommands || (exports.NotebookOutputCommands = NotebookOutputCommands = {}));
|
|
33
|
+
let NotebookOutputActionContribution = class NotebookOutputActionContribution {
|
|
34
|
+
registerCommands(commands) {
|
|
35
|
+
commands.registerCommand(NotebookOutputCommands.ENABLE_SCROLLING, {
|
|
36
|
+
execute: outputId => {
|
|
37
|
+
var _a;
|
|
38
|
+
const [cell, output] = (_a = this.findOutputAndCell(outputId)) !== null && _a !== void 0 ? _a : [];
|
|
39
|
+
if (cell && (output === null || output === void 0 ? void 0 : output.metadata)) {
|
|
40
|
+
output.metadata['scrollable'] = true;
|
|
41
|
+
cell.restartOutputRenderer(output.outputId);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
commands.registerCommand(NotebookOutputCommands.OPEN_LARGE_OUTPUT, {
|
|
46
|
+
execute: outputId => {
|
|
47
|
+
var _a;
|
|
48
|
+
const [cell, output] = (_a = this.findOutputAndCell(outputId)) !== null && _a !== void 0 ? _a : [];
|
|
49
|
+
if (cell && output) {
|
|
50
|
+
this.editorManager.open(common_1.CellUri.generateCellOutputUri(common_1.CellUri.parse(cell.uri).notebook, output.outputId));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
findOutputAndCell(output) {
|
|
56
|
+
var _a;
|
|
57
|
+
const model = (_a = this.notebookEditorService.focusedEditor) === null || _a === void 0 ? void 0 : _a.model;
|
|
58
|
+
if (!model) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const outputId = output.slice(0, output.lastIndexOf('-'));
|
|
62
|
+
for (const cell of model.cells) {
|
|
63
|
+
for (const outputModel of cell.outputs) {
|
|
64
|
+
if (outputModel.outputId === outputId) {
|
|
65
|
+
return [cell, outputModel];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
exports.NotebookOutputActionContribution = NotebookOutputActionContribution;
|
|
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
|
+
], NotebookOutputActionContribution.prototype, "notebookEditorService", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, inversify_1.inject)(browser_1.EditorManager),
|
|
78
|
+
tslib_1.__metadata("design:type", browser_1.EditorManager)
|
|
79
|
+
], NotebookOutputActionContribution.prototype, "editorManager", void 0);
|
|
80
|
+
exports.NotebookOutputActionContribution = NotebookOutputActionContribution = tslib_1.__decorate([
|
|
81
|
+
(0, inversify_1.injectable)()
|
|
82
|
+
], NotebookOutputActionContribution);
|
|
83
|
+
//# sourceMappingURL=notebook-output-action-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-output-action-contribution.js","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-output-action-contribution.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;;;;AAGhF,4DAAkE;AAClE,8FAAwF;AACxF,yCAAmD;AAEnD,uDAA0D;AAE1D,IAAiB,sBAAsB,CAOtC;AAPD,WAAiB,sBAAsB;IACtB,uCAAgB,GAAY;QACrC,EAAE,EAAE,4BAA4B;KACnC,CAAC;IACW,wCAAiB,GAAY;QACtC,EAAE,EAAE,kCAAkC;KACzC,CAAC;AACN,CAAC,EAPgB,sBAAsB,sCAAtB,sBAAsB,QAOtC;AAGM,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAQzC,gBAAgB,CAAC,QAAyB;QACtC,QAAQ,CAAC,eAAe,CAAC,sBAAsB,CAAC,gBAAgB,EAAE;YAC9D,OAAO,EAAE,QAAQ,CAAC,EAAE;;gBAChB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAC;gBAC9D,IAAI,IAAI,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAA,EAAE,CAAC;oBAC3B,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;oBACrC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAChD,CAAC;YACL,CAAC;SACJ,CAAC,CAAC;QAE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AD5C,IAAA,sBAAU,GAAE;GACA,gCAAgC,CA8C5C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StatusBar, Widget, WidgetStatusBarContribution } from '@theia/core/lib/browser';
|
|
2
|
+
import { Disposable } from '@theia/core/lib/common';
|
|
3
|
+
import { NotebookEditorWidget } from '../notebook-editor-widget';
|
|
4
|
+
export declare const NOTEBOOK_CELL_SELECTION_STATUS_BAR_ID = "notebook-cell-selection-position";
|
|
5
|
+
export declare class NotebookStatusBarContribution implements WidgetStatusBarContribution<NotebookEditorWidget> {
|
|
6
|
+
protected onDeactivate: Disposable | undefined;
|
|
7
|
+
canHandle(widget: Widget): widget is NotebookEditorWidget;
|
|
8
|
+
activate(statusBar: StatusBar, widget: NotebookEditorWidget): void;
|
|
9
|
+
deactivate(statusBar: StatusBar): void;
|
|
10
|
+
protected updateStatusbar(statusBar: StatusBar, editor?: NotebookEditorWidget): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=notebook-status-bar-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-status-bar-contribution.d.ts","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-status-bar-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAsB,MAAM,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,eAAO,MAAM,qCAAqC,qCAAqC,CAAC;AAExF,qBACa,6BAA8B,YAAW,2BAA2B,CAAC,oBAAoB,CAAC;IAEnG,SAAS,CAAC,YAAY,EAAE,UAAU,GAAG,SAAS,CAAC;IAE/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,oBAAoB;IAIzD,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAOlE,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;cAKtB,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBtG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.NotebookStatusBarContribution = exports.NOTEBOOK_CELL_SELECTION_STATUS_BAR_ID = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const notebook_editor_widget_1 = require("../notebook-editor-widget");
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
24
|
+
const notebook_actions_contribution_1 = require("./notebook-actions-contribution");
|
|
25
|
+
exports.NOTEBOOK_CELL_SELECTION_STATUS_BAR_ID = 'notebook-cell-selection-position';
|
|
26
|
+
let NotebookStatusBarContribution = class NotebookStatusBarContribution {
|
|
27
|
+
canHandle(widget) {
|
|
28
|
+
return widget instanceof notebook_editor_widget_1.NotebookEditorWidget;
|
|
29
|
+
}
|
|
30
|
+
activate(statusBar, widget) {
|
|
31
|
+
this.onDeactivate = widget.viewModel.onDidChangeSelectedCell(() => {
|
|
32
|
+
this.updateStatusbar(statusBar, widget);
|
|
33
|
+
});
|
|
34
|
+
this.updateStatusbar(statusBar, widget);
|
|
35
|
+
}
|
|
36
|
+
deactivate(statusBar) {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = this.onDeactivate) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
39
|
+
this.updateStatusbar(statusBar);
|
|
40
|
+
}
|
|
41
|
+
async updateStatusbar(statusBar, editor) {
|
|
42
|
+
const model = await (editor === null || editor === void 0 ? void 0 : editor.ready);
|
|
43
|
+
if (!model || model.cells.length === 0 || !(editor === null || editor === void 0 ? void 0 : editor.viewModel.selectedCell)) {
|
|
44
|
+
statusBar.removeElement(exports.NOTEBOOK_CELL_SELECTION_STATUS_BAR_ID);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const selectedCellIndex = model.cells.indexOf(editor.viewModel.selectedCell) + 1;
|
|
48
|
+
statusBar.setElement(exports.NOTEBOOK_CELL_SELECTION_STATUS_BAR_ID, {
|
|
49
|
+
text: core_1.nls.localizeByDefault('Cell {0} of {1}', selectedCellIndex, model.cells.length),
|
|
50
|
+
alignment: browser_1.StatusBarAlignment.RIGHT,
|
|
51
|
+
priority: 100,
|
|
52
|
+
command: notebook_actions_contribution_1.NotebookCommands.CENTER_ACTIVE_CELL.id,
|
|
53
|
+
arguments: [editor]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.NotebookStatusBarContribution = NotebookStatusBarContribution;
|
|
58
|
+
exports.NotebookStatusBarContribution = NotebookStatusBarContribution = tslib_1.__decorate([
|
|
59
|
+
(0, inversify_1.injectable)()
|
|
60
|
+
], NotebookStatusBarContribution);
|
|
61
|
+
//# sourceMappingURL=notebook-status-bar-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-status-bar-contribution.js","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-status-bar-contribution.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,4DAA0D;AAC1D,qDAA6G;AAE7G,sEAAiE;AACjE,sCAAkC;AAClC,mFAAmE;AAEtD,QAAA,qCAAqC,GAAG,kCAAkC,CAAC;AAGjF,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAItC,SAAS,CAAC,MAAc;QACpB,OAAO,MAAM,YAAY,6CAAoB,CAAC;IAClD,CAAC;IAED,QAAQ,CAAC,SAAoB,EAAE,MAA4B;QACvD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,EAAE;YAC9D,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,SAAoB;;QAC3B,MAAA,IAAI,CAAC,YAAY,0CAAE,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,MAA6B;QAC/E,MAAM,KAAK,GAAG,MAAM,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;QAClC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,YAAY,CAAA,EAAE,CAAC;YACxE,SAAS,CAAC,aAAa,CAAC,6CAAqC,CAAC,CAAC;YAC/D,OAAO;QACX,CAAC;QAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAEjF,SAAS,CAAC,UAAU,CAAC,6CAAqC,EAAE;YACxD,IAAI,EAAE,UAAG,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;YACrF,SAAS,EAAE,4BAAkB,CAAC,KAAK;YACnC,QAAQ,EAAE,GAAG;YACb,OAAO,EAAE,gDAAgB,CAAC,kBAAkB,CAAC,EAAE;YAC/C,SAAS,EAAE,CAAC,MAAM,CAAC;SACtB,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AArCY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAqCzC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplicationShell, UndoRedoHandler } from '@theia/core/lib/browser';
|
|
2
|
+
import { NotebookEditorWidget } from '../notebook-editor-widget';
|
|
3
|
+
export declare class NotebookUndoRedoHandler implements UndoRedoHandler<NotebookEditorWidget> {
|
|
4
|
+
protected readonly applicationShell: ApplicationShell;
|
|
5
|
+
priority: number;
|
|
6
|
+
select(): NotebookEditorWidget | undefined;
|
|
7
|
+
undo(item: NotebookEditorWidget): void;
|
|
8
|
+
redo(item: NotebookEditorWidget): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=notebook-undo-redo-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-undo-redo-handler.d.ts","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-undo-redo-handler.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,qBACa,uBAAwB,YAAW,eAAe,CAAC,oBAAoB,CAAC;IAGjF,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,QAAQ,SAAO;IACf,MAAM,IAAI,oBAAoB,GAAG,SAAS;IAO1C,IAAI,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI;IAGtC,IAAI,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI;CAGzC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.NotebookUndoRedoHandler = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const notebook_editor_widget_1 = require("../notebook-editor-widget");
|
|
23
|
+
let NotebookUndoRedoHandler = class NotebookUndoRedoHandler {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.priority = 200;
|
|
26
|
+
}
|
|
27
|
+
select() {
|
|
28
|
+
const current = this.applicationShell.currentWidget;
|
|
29
|
+
if (current instanceof notebook_editor_widget_1.NotebookEditorWidget) {
|
|
30
|
+
return current;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
undo(item) {
|
|
35
|
+
item.undo();
|
|
36
|
+
}
|
|
37
|
+
redo(item) {
|
|
38
|
+
item.redo();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.NotebookUndoRedoHandler = NotebookUndoRedoHandler;
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
44
|
+
tslib_1.__metadata("design:type", browser_1.ApplicationShell)
|
|
45
|
+
], NotebookUndoRedoHandler.prototype, "applicationShell", void 0);
|
|
46
|
+
exports.NotebookUndoRedoHandler = NotebookUndoRedoHandler = tslib_1.__decorate([
|
|
47
|
+
(0, inversify_1.injectable)()
|
|
48
|
+
], NotebookUndoRedoHandler);
|
|
49
|
+
//# sourceMappingURL=notebook-undo-redo-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-undo-redo-handler.js","sourceRoot":"","sources":["../../../src/browser/contributions/notebook-undo-redo-handler.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,qDAA4E;AAC5E,sEAAiE;AAG1D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAKH,aAAQ,GAAG,GAAG,CAAC;IAcnB,CAAC;IAbG,MAAM;QACF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC;QACpD,IAAI,OAAO,YAAY,6CAAoB,EAAE,CAAC;YAC1C,OAAO,OAAO,CAAC;QACnB,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,CAAC,IAA0B;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,IAA0B;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;CACJ,CAAA;AAnBY,0DAAuB;AAGb;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACY,0BAAgB;iEAAC;kCAH7C,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAmBnC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './notebook-type-registry';
|
|
2
|
+
export * from './notebook-renderer-registry';
|
|
3
|
+
export * from './notebook-editor-widget';
|
|
4
|
+
export * from './service/notebook-service';
|
|
5
|
+
export * from './service/notebook-editor-widget-service';
|
|
6
|
+
export * from './service/notebook-kernel-service';
|
|
7
|
+
export * from './service/notebook-execution-state-service';
|
|
8
|
+
export * from './service/notebook-model-resolver-service';
|
|
9
|
+
export * from './service/notebook-renderer-messaging-service';
|
|
10
|
+
export * from './service/notebook-cell-editor-service';
|
|
11
|
+
export * from './renderers/cell-output-webview';
|
|
12
|
+
export * from './notebook-types';
|
|
13
|
+
export * from './notebook-editor-split-contribution';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAgBA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kBAAkB,CAAC;AACjC,cAAc,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
const tslib_1 = require("tslib");
|
|
19
|
+
tslib_1.__exportStar(require("./notebook-type-registry"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./notebook-renderer-registry"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./notebook-editor-widget"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./service/notebook-service"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./service/notebook-editor-widget-service"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./service/notebook-kernel-service"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./service/notebook-execution-state-service"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./service/notebook-model-resolver-service"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./service/notebook-renderer-messaging-service"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./service/notebook-cell-editor-service"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./renderers/cell-output-webview"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./notebook-types"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./notebook-editor-split-contribution"), exports);
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.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,mEAAyC;AACzC,uEAA6C;AAC7C,mEAAyC;AACzC,qEAA2C;AAC3C,mFAAyD;AACzD,4EAAkD;AAClD,qFAA2D;AAC3D,oFAA0D;AAC1D,wFAA8D;AAC9D,iFAAuD;AACvD,0EAAgD;AAChD,2DAAiC;AACjC,+EAAqD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { URI, MaybePromise } from '@theia/core';
|
|
2
|
+
import { OpenHandler, OpenerOptions } from '@theia/core/lib/browser';
|
|
3
|
+
import { NotebookEditorWidgetService } from './service/notebook-editor-widget-service';
|
|
4
|
+
export declare class NotebookCellOpenHandler implements OpenHandler {
|
|
5
|
+
protected readonly notebookEditorWidgetService: NotebookEditorWidgetService;
|
|
6
|
+
id: string;
|
|
7
|
+
canHandle(uri: URI, options?: OpenerOptions | undefined): MaybePromise<number>;
|
|
8
|
+
open(uri: URI, options?: OpenerOptions | undefined): undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=notebook-cell-open-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-cell-open-handler.d.ts","sourceRoot":"","sources":["../../src/browser/notebook-cell-open-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAGvF,qBACa,uBAAwB,YAAW,WAAW;IAGvD,SAAS,CAAC,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B,CAAC;IAE5E,EAAE,EAAE,MAAM,CAA0B;IAEpC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC;IAI9E,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS;CAiBjE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.NotebookCellOpenHandler = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const notebook_editor_widget_service_1 = require("./service/notebook-editor-widget-service");
|
|
22
|
+
const common_1 = require("../common");
|
|
23
|
+
let NotebookCellOpenHandler = class NotebookCellOpenHandler {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.id = 'notebook-cell-opener';
|
|
26
|
+
}
|
|
27
|
+
canHandle(uri, options) {
|
|
28
|
+
return uri.scheme === common_1.CellUri.cellUriScheme ? 200 : 0;
|
|
29
|
+
}
|
|
30
|
+
open(uri, options) {
|
|
31
|
+
var _a, _b, _c, _d, _e;
|
|
32
|
+
const params = new URLSearchParams(uri.query);
|
|
33
|
+
const executionCountParam = params.get('execution_count');
|
|
34
|
+
const lineParam = params.get('line');
|
|
35
|
+
if (!executionCountParam || !lineParam) {
|
|
36
|
+
console.error('Invalid vscode-notebook-cell URI: missing execution_count or line parameter', uri.toString(true));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const executionCount = parseInt(executionCountParam);
|
|
40
|
+
const cell = (_b = (_a = this.notebookEditorWidgetService.currentEditor) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.cells.find(c => c.metadata.execution_count === executionCount);
|
|
41
|
+
(_e = (_c = this.notebookEditorWidgetService.currentEditor) === null || _c === void 0 ? void 0 : _c.viewModel.cellViewModels.get((_d = cell === null || cell === void 0 ? void 0 : cell.handle) !== null && _d !== void 0 ? _d : -1)) === null || _e === void 0 ? void 0 : _e.requestFocusEditor();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.NotebookCellOpenHandler = NotebookCellOpenHandler;
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, inversify_1.inject)(notebook_editor_widget_service_1.NotebookEditorWidgetService),
|
|
47
|
+
tslib_1.__metadata("design:type", notebook_editor_widget_service_1.NotebookEditorWidgetService)
|
|
48
|
+
], NotebookCellOpenHandler.prototype, "notebookEditorWidgetService", void 0);
|
|
49
|
+
exports.NotebookCellOpenHandler = NotebookCellOpenHandler = tslib_1.__decorate([
|
|
50
|
+
(0, inversify_1.injectable)()
|
|
51
|
+
], NotebookCellOpenHandler);
|
|
52
|
+
//# sourceMappingURL=notebook-cell-open-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-cell-open-handler.js","sourceRoot":"","sources":["../../src/browser/notebook-cell-open-handler.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;;;;AAIhF,4DAAkE;AAClE,6FAAuF;AACvF,sCAAoC;AAG7B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAKH,OAAE,GAAW,sBAAsB,CAAC;IAuBxC,CAAC;IArBG,SAAS,CAAC,GAAQ,EAAE,OAAmC;QACnD,OAAO,GAAG,CAAC,MAAM,KAAK,gBAAO,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,CAAC,GAAQ,EAAE,OAAmC;;QAC9C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC1D,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAErC,IAAI,CAAC,mBAAmB,IAAI,CAAC,SAAS,EAAE,CAAC;YACrC,OAAO,CAAC,KAAK,CAAC,6EAA6E,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YACjH,OAAO;QACX,CAAC;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAErD,MAAM,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,2BAA2B,CAAC,aAAa,0CAAE,KAAK,0CAAE,KAAK,CACpE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,KAAK,cAAc,CAAC,CAAC;QAC9D,MAAA,MAAA,IAAI,CAAC,2BAA2B,CAAC,aAAa,0CAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,mCAAI,CAAC,CAAC,CAAC,0CAAE,kBAAkB,EAAE,CAAC;IAC3H,CAAC;CAEJ,CAAA;AA5BY,0DAAuB;AAGb;IADlB,IAAA,kBAAM,EAAC,4DAA2B,CAAC;sCACY,4DAA2B;4EAAC;kCAHnE,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CA4BnC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Event, Emitter, Resource, ResourceReadOptions, ResourceResolver, URI } from '@theia/core';
|
|
2
|
+
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
|
|
3
|
+
import { NotebookService } from './service/notebook-service';
|
|
4
|
+
import { NotebookCellModel } from './view-model/notebook-cell-model';
|
|
5
|
+
import { NotebookModel } from './view-model/notebook-model';
|
|
6
|
+
export declare class NotebookCellResource implements Resource {
|
|
7
|
+
protected readonly onDidChangeContentsEmitter: Emitter<void>;
|
|
8
|
+
get onDidChangeContents(): Event<void>;
|
|
9
|
+
get onDidChangeReadOnly(): Event<boolean | MarkdownString> | undefined;
|
|
10
|
+
get readOnly(): boolean | MarkdownString | undefined;
|
|
11
|
+
protected cell: NotebookCellModel;
|
|
12
|
+
protected notebook: NotebookModel;
|
|
13
|
+
uri: URI;
|
|
14
|
+
constructor(uri: URI, notebook: NotebookModel, cell: NotebookCellModel);
|
|
15
|
+
readContents(options?: ResourceReadOptions | undefined): Promise<string>;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class NotebookCellResourceResolver implements ResourceResolver {
|
|
19
|
+
protected readonly notebookService: NotebookService;
|
|
20
|
+
resolve(uri: URI): Promise<Resource>;
|
|
21
|
+
}
|
|
22
|
+
export declare class NotebookOutputResourceResolver implements ResourceResolver {
|
|
23
|
+
protected readonly notebookService: NotebookService;
|
|
24
|
+
resolve(uri: URI): Promise<Resource>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=notebook-cell-resource-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-cell-resource-resolver.d.ts","sourceRoot":"","sources":["../../src/browser/notebook-cell-resource-resolver.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEnG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,qBAAa,oBAAqB,YAAW,QAAQ;IAEjD,SAAS,CAAC,QAAQ,CAAC,0BAA0B,gBAAuB;IACpE,IAAI,mBAAmB,IAAI,KAAK,CAAC,IAAI,CAAC,CAErC;IAED,IAAI,mBAAmB,IAAI,KAAK,CAAC,OAAO,GAAG,cAAc,CAAC,GAAG,SAAS,CAErE;IAED,IAAI,QAAQ,IAAI,OAAO,GAAG,cAAc,GAAG,SAAS,CAEnD;IAED,SAAS,CAAC,IAAI,EAAE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