@codingame/monaco-vscode-notebook-service-override 3.2.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/notebook.js +13 -13
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -8
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +0 -389
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -488
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -91
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -118
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -59
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -148
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -383
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -511
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -565
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -707
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -267
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -45
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -890
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -393
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -175
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1174
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -509
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1003
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -202
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -376
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { $, addStandardDisposableListener, addDisposableListener, EventType, append } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
-
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { SideBySideDiffElementViewModel } from './diffElementViewModel.js';
|
|
6
|
-
import { DiffSide } from './notebookDiffEditorBrowser.js';
|
|
7
|
-
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
8
|
-
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
9
|
-
import { mimetypeIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
10
|
-
import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
|
|
11
|
-
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
12
|
-
|
|
13
|
-
class OutputElement extends Disposable {
|
|
14
|
-
constructor(_notebookEditor, _notebookTextModel, _notebookService, _quickInputService, _diffElementViewModel, _diffSide, _nestedCell, _outputContainer, output) {
|
|
15
|
-
super();
|
|
16
|
-
this._notebookEditor = _notebookEditor;
|
|
17
|
-
this._notebookTextModel = _notebookTextModel;
|
|
18
|
-
this._notebookService = _notebookService;
|
|
19
|
-
this._quickInputService = _quickInputService;
|
|
20
|
-
this._diffElementViewModel = _diffElementViewModel;
|
|
21
|
-
this._diffSide = _diffSide;
|
|
22
|
-
this._nestedCell = _nestedCell;
|
|
23
|
-
this._outputContainer = _outputContainer;
|
|
24
|
-
this.output = output;
|
|
25
|
-
this.resizeListener = this._register(( new DisposableStore()));
|
|
26
|
-
}
|
|
27
|
-
render(index, beforeElement) {
|
|
28
|
-
const outputItemDiv = document.createElement('div');
|
|
29
|
-
let result = undefined;
|
|
30
|
-
const [mimeTypes, pick] = this.output.resolveMimeTypes(this._notebookTextModel, undefined);
|
|
31
|
-
const pickedMimeTypeRenderer = mimeTypes[pick];
|
|
32
|
-
if (mimeTypes.length > 1) {
|
|
33
|
-
outputItemDiv.style.position = 'relative';
|
|
34
|
-
const mimeTypePicker = $('.multi-mimetype-output');
|
|
35
|
-
mimeTypePicker.classList.add(...ThemeIcon.asClassNameArray(mimetypeIcon));
|
|
36
|
-
mimeTypePicker.tabIndex = 0;
|
|
37
|
-
mimeTypePicker.title = ( localizeWithPath(
|
|
38
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
39
|
-
'mimeTypePicker',
|
|
40
|
-
"Choose a different output mimetype, available mimetypes: {0}",
|
|
41
|
-
( mimeTypes.map(mimeType => mimeType.mimeType)).join(', ')
|
|
42
|
-
));
|
|
43
|
-
outputItemDiv.appendChild(mimeTypePicker);
|
|
44
|
-
this.resizeListener.add(addStandardDisposableListener(mimeTypePicker, 'mousedown', async (e) => {
|
|
45
|
-
if (e.leftButton) {
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
e.stopPropagation();
|
|
48
|
-
await this.pickActiveMimeTypeRenderer(this._notebookTextModel, this.output);
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
this.resizeListener.add((addDisposableListener(mimeTypePicker, EventType.KEY_DOWN, async (e) => {
|
|
52
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
53
|
-
if ((event.equals(3 ) || event.equals(10 ))) {
|
|
54
|
-
e.preventDefault();
|
|
55
|
-
e.stopPropagation();
|
|
56
|
-
await this.pickActiveMimeTypeRenderer(this._notebookTextModel, this.output);
|
|
57
|
-
}
|
|
58
|
-
})));
|
|
59
|
-
}
|
|
60
|
-
const innerContainer = $('.output-inner-container');
|
|
61
|
-
append(outputItemDiv, innerContainer);
|
|
62
|
-
if (mimeTypes.length !== 0) {
|
|
63
|
-
const renderer = this._notebookService.getRendererInfo(pickedMimeTypeRenderer.rendererId);
|
|
64
|
-
result = renderer
|
|
65
|
-
? { type: 1 , renderer, source: this.output, mimeType: pickedMimeTypeRenderer.mimeType }
|
|
66
|
-
: this._renderMissingRenderer(this.output, pickedMimeTypeRenderer.mimeType);
|
|
67
|
-
this.output.pickedMimeType = pickedMimeTypeRenderer;
|
|
68
|
-
}
|
|
69
|
-
this.domNode = outputItemDiv;
|
|
70
|
-
this.renderResult = result;
|
|
71
|
-
if (!result) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (beforeElement) {
|
|
75
|
-
this._outputContainer.insertBefore(outputItemDiv, beforeElement);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
this._outputContainer.appendChild(outputItemDiv);
|
|
79
|
-
}
|
|
80
|
-
this._notebookEditor.createOutput(this._diffElementViewModel, this._nestedCell, result, () => this.getOutputOffsetInCell(index), this._diffElementViewModel instanceof SideBySideDiffElementViewModel
|
|
81
|
-
? this._diffSide
|
|
82
|
-
: this._diffElementViewModel.type === 'insert' ? DiffSide.Modified : DiffSide.Original);
|
|
83
|
-
}
|
|
84
|
-
_renderMissingRenderer(viewModel, preferredMimeType) {
|
|
85
|
-
if (!viewModel.model.outputs.length) {
|
|
86
|
-
return this._renderMessage(viewModel, ( localizeWithPath(
|
|
87
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
88
|
-
'empty',
|
|
89
|
-
"Cell has no output"
|
|
90
|
-
)));
|
|
91
|
-
}
|
|
92
|
-
if (!preferredMimeType) {
|
|
93
|
-
const mimeTypes = ( viewModel.model.outputs.map(op => op.mime));
|
|
94
|
-
const mimeTypesMessage = mimeTypes.join(', ');
|
|
95
|
-
return this._renderMessage(viewModel, ( localizeWithPath(
|
|
96
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
97
|
-
'noRenderer.2',
|
|
98
|
-
"No renderer could be found for output. It has the following mimetypes: {0}",
|
|
99
|
-
mimeTypesMessage
|
|
100
|
-
)));
|
|
101
|
-
}
|
|
102
|
-
return this._renderSearchForMimetype(viewModel, preferredMimeType);
|
|
103
|
-
}
|
|
104
|
-
_renderSearchForMimetype(viewModel, mimeType) {
|
|
105
|
-
const query = `@tag:notebookRenderer ${mimeType}`;
|
|
106
|
-
const p = $('p', undefined, `No renderer could be found for mimetype "${mimeType}", but one might be available on the Marketplace.`);
|
|
107
|
-
const a = $('a', { href: `command:workbench.extensions.search?%22${query}%22`, class: 'monaco-button monaco-text-button', tabindex: 0, role: 'button', style: 'padding: 8px; text-decoration: none; color: rgb(255, 255, 255); background-color: rgb(14, 99, 156); max-width: 200px;' }, `Search Marketplace`);
|
|
108
|
-
return {
|
|
109
|
-
type: 0 ,
|
|
110
|
-
source: viewModel,
|
|
111
|
-
htmlContent: p.outerHTML + a.outerHTML,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
_renderMessage(viewModel, message) {
|
|
115
|
-
const el = $('p', undefined, message);
|
|
116
|
-
return { type: 0 , source: viewModel, htmlContent: el.outerHTML };
|
|
117
|
-
}
|
|
118
|
-
async pickActiveMimeTypeRenderer(notebookTextModel, viewModel) {
|
|
119
|
-
const [mimeTypes, currIndex] = viewModel.resolveMimeTypes(notebookTextModel, undefined);
|
|
120
|
-
const items = ( mimeTypes.filter(mimeType => mimeType.isTrusted).map((mimeType, index) => ({
|
|
121
|
-
label: mimeType.mimeType,
|
|
122
|
-
id: mimeType.mimeType,
|
|
123
|
-
index: index,
|
|
124
|
-
picked: index === currIndex,
|
|
125
|
-
detail: this.generateRendererInfo(mimeType.rendererId),
|
|
126
|
-
description: index === currIndex ? ( localizeWithPath(
|
|
127
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
128
|
-
'curruentActiveMimeType',
|
|
129
|
-
"Currently Active"
|
|
130
|
-
)) : undefined
|
|
131
|
-
})));
|
|
132
|
-
const picker = this._quickInputService.createQuickPick();
|
|
133
|
-
picker.items = items;
|
|
134
|
-
picker.activeItems = items.filter(item => !!item.picked);
|
|
135
|
-
picker.placeholder = items.length !== mimeTypes.length
|
|
136
|
-
? ( localizeWithPath(
|
|
137
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
138
|
-
'promptChooseMimeTypeInSecure.placeHolder',
|
|
139
|
-
"Select mimetype to render for current output. Rich mimetypes are available only when the notebook is trusted"
|
|
140
|
-
))
|
|
141
|
-
: ( localizeWithPath(
|
|
142
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
143
|
-
'promptChooseMimeType.placeHolder',
|
|
144
|
-
"Select mimetype to render for current output"
|
|
145
|
-
));
|
|
146
|
-
const pick = await ( new Promise(resolve => {
|
|
147
|
-
picker.onDidAccept(() => {
|
|
148
|
-
resolve(picker.selectedItems.length === 1 ? picker.selectedItems[0].index : undefined);
|
|
149
|
-
picker.dispose();
|
|
150
|
-
});
|
|
151
|
-
picker.show();
|
|
152
|
-
}));
|
|
153
|
-
if (pick === undefined) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (pick !== currIndex) {
|
|
157
|
-
const index = this._nestedCell.outputsViewModels.indexOf(viewModel);
|
|
158
|
-
const nextElement = this.domNode.nextElementSibling;
|
|
159
|
-
this.resizeListener.clear();
|
|
160
|
-
const element = this.domNode;
|
|
161
|
-
if (element) {
|
|
162
|
-
element.parentElement?.removeChild(element);
|
|
163
|
-
this._notebookEditor.removeInset(this._diffElementViewModel, this._nestedCell, viewModel, this._diffSide);
|
|
164
|
-
}
|
|
165
|
-
viewModel.pickedMimeType = mimeTypes[pick];
|
|
166
|
-
this.render(index, nextElement);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
generateRendererInfo(renderId) {
|
|
170
|
-
const renderInfo = this._notebookService.getRendererInfo(renderId);
|
|
171
|
-
if (renderInfo) {
|
|
172
|
-
const displayName = renderInfo.displayName !== '' ? renderInfo.displayName : renderInfo.id;
|
|
173
|
-
return `${displayName} (${renderInfo.extensionId.value})`;
|
|
174
|
-
}
|
|
175
|
-
return ( localizeWithPath(
|
|
176
|
-
'vs/workbench/contrib/notebook/browser/diff/diffElementOutputs',
|
|
177
|
-
'builtinRenderInfo',
|
|
178
|
-
"built-in"
|
|
179
|
-
));
|
|
180
|
-
}
|
|
181
|
-
getCellOutputCurrentIndex() {
|
|
182
|
-
return this._diffElementViewModel.getNestedCellViewModel(this._diffSide).outputs.indexOf(this.output.model);
|
|
183
|
-
}
|
|
184
|
-
updateHeight(index, height) {
|
|
185
|
-
this._diffElementViewModel.updateOutputHeight(this._diffSide, index, height);
|
|
186
|
-
}
|
|
187
|
-
getOutputOffsetInContainer(index) {
|
|
188
|
-
return this._diffElementViewModel.getOutputOffsetInContainer(this._diffSide, index);
|
|
189
|
-
}
|
|
190
|
-
getOutputOffsetInCell(index) {
|
|
191
|
-
return this._diffElementViewModel.getOutputOffsetInCell(this._diffSide, index);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
let OutputContainer = class OutputContainer extends Disposable {
|
|
195
|
-
constructor(_editor, _notebookTextModel, _diffElementViewModel, _nestedCellViewModel, _diffSide, _outputContainer, _notebookService, _quickInputService) {
|
|
196
|
-
super();
|
|
197
|
-
this._editor = _editor;
|
|
198
|
-
this._notebookTextModel = _notebookTextModel;
|
|
199
|
-
this._diffElementViewModel = _diffElementViewModel;
|
|
200
|
-
this._nestedCellViewModel = _nestedCellViewModel;
|
|
201
|
-
this._diffSide = _diffSide;
|
|
202
|
-
this._outputContainer = _outputContainer;
|
|
203
|
-
this._notebookService = _notebookService;
|
|
204
|
-
this._quickInputService = _quickInputService;
|
|
205
|
-
this._outputEntries = ( new Map());
|
|
206
|
-
this._register(this._diffElementViewModel.onDidLayoutChange(() => {
|
|
207
|
-
this._outputEntries.forEach((value, key) => {
|
|
208
|
-
const index = _nestedCellViewModel.outputs.indexOf(key.model);
|
|
209
|
-
if (index >= 0) {
|
|
210
|
-
const top = this._diffElementViewModel.getOutputOffsetInContainer(this._diffSide, index);
|
|
211
|
-
value.domNode.style.top = `${top}px`;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}));
|
|
215
|
-
this._register(this._nestedCellViewModel.textModel.onDidChangeOutputs(splice => {
|
|
216
|
-
this._updateOutputs(splice);
|
|
217
|
-
}));
|
|
218
|
-
}
|
|
219
|
-
_updateOutputs(splice) {
|
|
220
|
-
const removedKeys = [];
|
|
221
|
-
this._outputEntries.forEach((value, key) => {
|
|
222
|
-
if (this._nestedCellViewModel.outputsViewModels.indexOf(key) < 0) {
|
|
223
|
-
removedKeys.push(key);
|
|
224
|
-
this._outputContainer.removeChild(value.domNode);
|
|
225
|
-
this._editor.removeInset(this._diffElementViewModel, this._nestedCellViewModel, key, this._diffSide);
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
removedKeys.forEach(key => {
|
|
229
|
-
this._outputEntries.get(key)?.dispose();
|
|
230
|
-
this._outputEntries.delete(key);
|
|
231
|
-
});
|
|
232
|
-
let prevElement = undefined;
|
|
233
|
-
const outputsToRender = this._nestedCellViewModel.outputsViewModels;
|
|
234
|
-
outputsToRender.reverse().forEach(output => {
|
|
235
|
-
if (( this._outputEntries.has(output))) {
|
|
236
|
-
prevElement = this._outputEntries.get(output).domNode;
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
const currIndex = this._nestedCellViewModel.outputsViewModels.indexOf(output);
|
|
240
|
-
this._renderOutput(output, currIndex, prevElement);
|
|
241
|
-
prevElement = this._outputEntries.get(output)?.domNode;
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
render() {
|
|
245
|
-
for (let index = 0; index < this._nestedCellViewModel.outputsViewModels.length; index++) {
|
|
246
|
-
const currOutput = this._nestedCellViewModel.outputsViewModels[index];
|
|
247
|
-
this._renderOutput(currOutput, index, undefined);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
showOutputs() {
|
|
251
|
-
for (let index = 0; index < this._nestedCellViewModel.outputsViewModels.length; index++) {
|
|
252
|
-
const currOutput = this._nestedCellViewModel.outputsViewModels[index];
|
|
253
|
-
this._editor.showInset(this._diffElementViewModel, currOutput.cellViewModel, currOutput, this._diffSide);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
hideOutputs() {
|
|
257
|
-
this._outputEntries.forEach((outputElement, cellOutputViewModel) => {
|
|
258
|
-
this._editor.hideInset(this._diffElementViewModel, this._nestedCellViewModel, cellOutputViewModel);
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
_renderOutput(currOutput, index, beforeElement) {
|
|
262
|
-
if (!( this._outputEntries.has(currOutput))) {
|
|
263
|
-
this._outputEntries.set(currOutput, ( new OutputElement(
|
|
264
|
-
this._editor,
|
|
265
|
-
this._notebookTextModel,
|
|
266
|
-
this._notebookService,
|
|
267
|
-
this._quickInputService,
|
|
268
|
-
this._diffElementViewModel,
|
|
269
|
-
this._diffSide,
|
|
270
|
-
this._nestedCellViewModel,
|
|
271
|
-
this._outputContainer,
|
|
272
|
-
currOutput
|
|
273
|
-
)));
|
|
274
|
-
}
|
|
275
|
-
const renderElement = this._outputEntries.get(currOutput);
|
|
276
|
-
renderElement.render(index, beforeElement);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
OutputContainer = ( __decorate([
|
|
280
|
-
( __param(6, INotebookService)),
|
|
281
|
-
( __param(7, IQuickInputService))
|
|
282
|
-
], OutputContainer));
|
|
283
|
-
|
|
284
|
-
export { OutputContainer, OutputElement };
|