@codingame/monaco-vscode-notebook-service-override 8.0.4 → 9.0.2

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 (58) hide show
  1. package/package.json +3 -2
  2. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +8 -8
  3. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +21 -21
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +2 -2
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +1 -1
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +3 -3
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +6 -6
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +26 -24
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +2 -2
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +4 -4
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +1 -1
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +1 -1
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +624 -0
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +13 -13
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +1 -1
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +4 -5
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +9 -9
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +12 -12
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +3 -3
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +24 -24
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +54 -55
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +22 -22
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +23 -21
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +7 -7
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +12 -12
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +297 -21
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +124 -73
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +27 -19
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +62 -39
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +7 -6
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +3 -3
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +7 -1
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +18 -6
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +15 -40
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +0 -1
  42. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +28 -0
  43. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +55 -45
  44. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +6 -6
  45. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +12 -12
  46. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -47
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1303
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -267
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -569
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -115
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -903
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -397
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -186
  58. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -107
@@ -1,13 +0,0 @@
1
- import { RawContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
2
-
3
- var DiffSide;
4
- ( (function(DiffSide) {
5
- DiffSide[DiffSide["Original"] = 0] = "Original";
6
- DiffSide[DiffSide["Modified"] = 1] = "Modified";
7
- })(DiffSide || (DiffSide = {})));
8
- const DIFF_CELL_MARGIN = 16;
9
- const NOTEBOOK_DIFF_CELL_INPUT = ( new RawContextKey('notebookDiffCellInputChanged', false));
10
- const NOTEBOOK_DIFF_CELL_PROPERTY = ( new RawContextKey('notebookDiffCellPropertyChanged', false));
11
- const NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED = ( new RawContextKey('notebookDiffCellPropertyExpanded', false));
12
-
13
- export { DIFF_CELL_MARGIN, DiffSide, NOTEBOOK_DIFF_CELL_INPUT, NOTEBOOK_DIFF_CELL_PROPERTY, NOTEBOOK_DIFF_CELL_PROPERTY_EXPANDED };
@@ -1,397 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import './notebookDiff.css.js';
3
- import { $, append, createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
4
- import { MouseController, isMonacoEditor } from 'vscode/vscode/vs/base/browser/ui/list/listWidget';
5
- import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
6
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
7
- import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
8
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
9
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
10
- import { WorkbenchList } from 'vscode/vscode/vs/platform/list/browser/listService';
11
- import { IListService } from 'vscode/vscode/vs/platform/list/browser/listService.service';
12
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
13
- import { DIFF_CELL_MARGIN } from './notebookDiffEditorBrowser.js';
14
- import { InsertElement, DeletedElement, getOptimizedNestedCodeEditorWidgetOptions, ModifiedElement } from './diffComponents.js';
15
- import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
16
- import { DiffEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
17
- import { MenuItemAction } from 'vscode/vscode/vs/platform/actions/common/actions';
18
- import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
19
- import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
20
- import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
21
- import { CodiconActionViewItem } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView';
22
- import { BareFontInfo } from 'vscode/vscode/vs/editor/common/config/fontInfo';
23
- import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
24
- import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
25
- import { fixedEditorOptions, fixedDiffEditorOptions } from './diffCellEditorOptions.js';
26
- import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
27
-
28
- var CellDiffSingleSideRenderer_1, CellDiffSideBySideRenderer_1;
29
- let NotebookCellTextDiffListDelegate = class NotebookCellTextDiffListDelegate {
30
- constructor(targetWindow, configurationService) {
31
- this.configurationService = configurationService;
32
- const editorOptions = this.configurationService.getValue('editor');
33
- this.lineHeight = BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.getInstance(targetWindow).value).lineHeight;
34
- }
35
- getHeight(element) {
36
- return element.getHeight(this.lineHeight);
37
- }
38
- hasDynamicHeight(element) {
39
- return false;
40
- }
41
- getTemplateId(element) {
42
- switch (element.type) {
43
- case 'delete':
44
- case 'insert':
45
- return CellDiffSingleSideRenderer.TEMPLATE_ID;
46
- case 'modified':
47
- case 'unchanged':
48
- return CellDiffSideBySideRenderer.TEMPLATE_ID;
49
- }
50
- }
51
- };
52
- NotebookCellTextDiffListDelegate = ( __decorate([
53
- ( __param(1, IConfigurationService))
54
- ], NotebookCellTextDiffListDelegate));
55
- let CellDiffSingleSideRenderer = class CellDiffSingleSideRenderer {
56
- static { CellDiffSingleSideRenderer_1 = this; }
57
- static { this.TEMPLATE_ID = 'cell_diff_single'; }
58
- constructor(notebookEditor, instantiationService) {
59
- this.notebookEditor = notebookEditor;
60
- this.instantiationService = instantiationService;
61
- }
62
- get templateId() {
63
- return CellDiffSingleSideRenderer_1.TEMPLATE_ID;
64
- }
65
- renderTemplate(container) {
66
- const body = $('.cell-body');
67
- append(container, body);
68
- const diffEditorContainer = $('.cell-diff-editor-container');
69
- append(body, diffEditorContainer);
70
- const diagonalFill = append(body, $('.diagonal-fill'));
71
- const sourceContainer = append(diffEditorContainer, $('.source-container'));
72
- const editor = this._buildSourceEditor(sourceContainer);
73
- const metadataHeaderContainer = append(diffEditorContainer, $('.metadata-header-container'));
74
- const metadataInfoContainer = append(diffEditorContainer, $('.metadata-info-container'));
75
- const outputHeaderContainer = append(diffEditorContainer, $('.output-header-container'));
76
- const outputInfoContainer = append(diffEditorContainer, $('.output-info-container'));
77
- const borderContainer = append(body, $('.border-container'));
78
- const leftBorder = append(borderContainer, $('.left-border'));
79
- const rightBorder = append(borderContainer, $('.right-border'));
80
- const topBorder = append(borderContainer, $('.top-border'));
81
- const bottomBorder = append(borderContainer, $('.bottom-border'));
82
- return {
83
- body,
84
- container,
85
- diffEditorContainer,
86
- diagonalFill,
87
- sourceEditor: editor,
88
- metadataHeaderContainer,
89
- metadataInfoContainer,
90
- outputHeaderContainer,
91
- outputInfoContainer,
92
- leftBorder,
93
- rightBorder,
94
- topBorder,
95
- bottomBorder,
96
- elementDisposables: ( new DisposableStore())
97
- };
98
- }
99
- _buildSourceEditor(sourceContainer) {
100
- const editorContainer = append(sourceContainer, $('.editor-container'));
101
- const editor = this.instantiationService.createInstance(CodeEditorWidget, editorContainer, {
102
- ...fixedEditorOptions,
103
- dimension: {
104
- width: (this.notebookEditor.getLayoutInfo().width - 2 * DIFF_CELL_MARGIN) / 2 - 18,
105
- height: 0
106
- },
107
- automaticLayout: false,
108
- overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode()
109
- }, {});
110
- return editor;
111
- }
112
- renderElement(element, index, templateData, height) {
113
- templateData.body.classList.remove('left', 'right', 'full');
114
- switch (element.type) {
115
- case 'delete':
116
- templateData.elementDisposables.add(this.instantiationService.createInstance(DeletedElement, this.notebookEditor, element, templateData));
117
- return;
118
- case 'insert':
119
- templateData.elementDisposables.add(this.instantiationService.createInstance(InsertElement, this.notebookEditor, element, templateData));
120
- return;
121
- }
122
- }
123
- disposeTemplate(templateData) {
124
- templateData.container.innerText = '';
125
- templateData.sourceEditor.dispose();
126
- templateData.elementDisposables.dispose();
127
- }
128
- disposeElement(element, index, templateData) {
129
- templateData.elementDisposables.clear();
130
- }
131
- };
132
- CellDiffSingleSideRenderer = CellDiffSingleSideRenderer_1 = ( __decorate([
133
- ( __param(1, IInstantiationService))
134
- ], CellDiffSingleSideRenderer));
135
- let CellDiffSideBySideRenderer = class CellDiffSideBySideRenderer {
136
- static { CellDiffSideBySideRenderer_1 = this; }
137
- static { this.TEMPLATE_ID = 'cell_diff_side_by_side'; }
138
- constructor(notebookEditor, instantiationService, contextMenuService, keybindingService, menuService, contextKeyService, notificationService, themeService, accessibilityService) {
139
- this.notebookEditor = notebookEditor;
140
- this.instantiationService = instantiationService;
141
- this.contextMenuService = contextMenuService;
142
- this.keybindingService = keybindingService;
143
- this.menuService = menuService;
144
- this.contextKeyService = contextKeyService;
145
- this.notificationService = notificationService;
146
- this.themeService = themeService;
147
- this.accessibilityService = accessibilityService;
148
- }
149
- get templateId() {
150
- return CellDiffSideBySideRenderer_1.TEMPLATE_ID;
151
- }
152
- renderTemplate(container) {
153
- const body = $('.cell-body');
154
- append(container, body);
155
- const diffEditorContainer = $('.cell-diff-editor-container');
156
- append(body, diffEditorContainer);
157
- const sourceContainer = append(diffEditorContainer, $('.source-container'));
158
- const { editor, editorContainer } = this._buildSourceEditor(sourceContainer);
159
- const inputToolbarContainer = append(sourceContainer, $('.editor-input-toolbar-container'));
160
- const cellToolbarContainer = append(inputToolbarContainer, $('div.property-toolbar'));
161
- const toolbar = this.instantiationService.createInstance(WorkbenchToolBar, cellToolbarContainer, {
162
- actionViewItemProvider: (action, options) => {
163
- if (action instanceof MenuItemAction) {
164
- const item = ( new CodiconActionViewItem(
165
- action,
166
- { hoverDelegate: options.hoverDelegate },
167
- this.keybindingService,
168
- this.notificationService,
169
- this.contextKeyService,
170
- this.themeService,
171
- this.contextMenuService,
172
- this.accessibilityService
173
- ));
174
- return item;
175
- }
176
- return undefined;
177
- }
178
- });
179
- const metadataHeaderContainer = append(diffEditorContainer, $('.metadata-header-container'));
180
- const metadataInfoContainer = append(diffEditorContainer, $('.metadata-info-container'));
181
- const outputHeaderContainer = append(diffEditorContainer, $('.output-header-container'));
182
- const outputInfoContainer = append(diffEditorContainer, $('.output-info-container'));
183
- const borderContainer = append(body, $('.border-container'));
184
- const leftBorder = append(borderContainer, $('.left-border'));
185
- const rightBorder = append(borderContainer, $('.right-border'));
186
- const topBorder = append(borderContainer, $('.top-border'));
187
- const bottomBorder = append(borderContainer, $('.bottom-border'));
188
- return {
189
- body,
190
- container,
191
- diffEditorContainer,
192
- sourceEditor: editor,
193
- editorContainer,
194
- inputToolbarContainer,
195
- toolbar,
196
- metadataHeaderContainer,
197
- metadataInfoContainer,
198
- outputHeaderContainer,
199
- outputInfoContainer,
200
- leftBorder,
201
- rightBorder,
202
- topBorder,
203
- bottomBorder,
204
- elementDisposables: ( new DisposableStore())
205
- };
206
- }
207
- _buildSourceEditor(sourceContainer) {
208
- const editorContainer = append(sourceContainer, $('.editor-container'));
209
- const editor = this.instantiationService.createInstance(DiffEditorWidget, editorContainer, {
210
- ...fixedDiffEditorOptions,
211
- padding: {
212
- top: 24,
213
- bottom: 12
214
- },
215
- overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
216
- originalEditable: false,
217
- ignoreTrimWhitespace: false,
218
- automaticLayout: false,
219
- dimension: {
220
- height: 0,
221
- width: 0
222
- },
223
- renderSideBySide: true,
224
- useInlineViewWhenSpaceIsLimited: false
225
- }, {
226
- originalEditor: getOptimizedNestedCodeEditorWidgetOptions(),
227
- modifiedEditor: getOptimizedNestedCodeEditorWidgetOptions()
228
- });
229
- return {
230
- editor,
231
- editorContainer
232
- };
233
- }
234
- renderElement(element, index, templateData, height) {
235
- templateData.body.classList.remove('left', 'right', 'full');
236
- switch (element.type) {
237
- case 'unchanged':
238
- templateData.elementDisposables.add(this.instantiationService.createInstance(ModifiedElement, this.notebookEditor, element, templateData));
239
- return;
240
- case 'modified':
241
- templateData.elementDisposables.add(this.instantiationService.createInstance(ModifiedElement, this.notebookEditor, element, templateData));
242
- return;
243
- }
244
- }
245
- disposeTemplate(templateData) {
246
- templateData.container.innerText = '';
247
- templateData.sourceEditor.dispose();
248
- templateData.toolbar?.dispose();
249
- templateData.elementDisposables.dispose();
250
- }
251
- disposeElement(element, index, templateData) {
252
- if (templateData.toolbar) {
253
- templateData.toolbar.context = undefined;
254
- }
255
- templateData.elementDisposables.clear();
256
- }
257
- };
258
- CellDiffSideBySideRenderer = CellDiffSideBySideRenderer_1 = ( __decorate([
259
- ( __param(1, IInstantiationService)),
260
- ( __param(2, IContextMenuService)),
261
- ( __param(3, IKeybindingService)),
262
- ( __param(4, IMenuService)),
263
- ( __param(5, IContextKeyService)),
264
- ( __param(6, INotificationService)),
265
- ( __param(7, IThemeService)),
266
- ( __param(8, IAccessibilityService))
267
- ], CellDiffSideBySideRenderer));
268
- class NotebookMouseController extends MouseController {
269
- onViewPointer(e) {
270
- if (isMonacoEditor(e.browserEvent.target)) {
271
- const focus = typeof e.index === 'undefined' ? [] : [e.index];
272
- this.list.setFocus(focus, e.browserEvent);
273
- }
274
- else {
275
- super.onViewPointer(e);
276
- }
277
- }
278
- }
279
- let NotebookTextDiffList = class NotebookTextDiffList extends WorkbenchList {
280
- get rowsContainer() {
281
- return this.view.containerDomNode;
282
- }
283
- constructor(listUser, container, delegate, renderers, contextKeyService, options, listService, configurationService, instantiationService) {
284
- super(listUser, container, delegate, renderers, options, contextKeyService, listService, configurationService, instantiationService);
285
- }
286
- createMouseController(options) {
287
- return ( new NotebookMouseController(this));
288
- }
289
- getCellViewScrollTop(element) {
290
- const index = this.indexOf(element);
291
- return this.view.elementTop(index);
292
- }
293
- getScrollHeight() {
294
- return this.view.scrollHeight;
295
- }
296
- triggerScrollFromMouseWheelEvent(browserEvent) {
297
- this.view.delegateScrollFromMouseWheelEvent(browserEvent);
298
- }
299
- delegateVerticalScrollbarPointerDown(browserEvent) {
300
- this.view.delegateVerticalScrollbarPointerDown(browserEvent);
301
- }
302
- clear() {
303
- super.splice(0, this.length);
304
- }
305
- updateElementHeight2(element, size) {
306
- const viewIndex = this.indexOf(element);
307
- const focused = this.getFocus();
308
- this.view.updateElementHeight(viewIndex, size, focused.length ? focused[0] : null);
309
- }
310
- style(styles) {
311
- const selectorSuffix = this.view.domId;
312
- if (!this.styleElement) {
313
- this.styleElement = createStyleSheet(this.view.domNode);
314
- }
315
- const suffix = selectorSuffix && `.${selectorSuffix}`;
316
- const content = [];
317
- if (styles.listBackground) {
318
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows { background: ${styles.listBackground}; }`);
319
- }
320
- if (styles.listFocusBackground) {
321
- content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`);
322
- content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`);
323
- }
324
- if (styles.listFocusForeground) {
325
- content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`);
326
- }
327
- if (styles.listActiveSelectionBackground) {
328
- content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`);
329
- content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`);
330
- }
331
- if (styles.listActiveSelectionForeground) {
332
- content.push(`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`);
333
- }
334
- if (styles.listFocusAndSelectionBackground) {
335
- content.push(`
336
- .monaco-drag-image,
337
- .monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; }
338
- `);
339
- }
340
- if (styles.listFocusAndSelectionForeground) {
341
- content.push(`
342
- .monaco-drag-image,
343
- .monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; }
344
- `);
345
- }
346
- if (styles.listInactiveFocusBackground) {
347
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`);
348
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`);
349
- }
350
- if (styles.listInactiveSelectionBackground) {
351
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`);
352
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`);
353
- }
354
- if (styles.listInactiveSelectionForeground) {
355
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`);
356
- }
357
- if (styles.listHoverBackground) {
358
- content.push(`.monaco-list${suffix}:not(.drop-target) > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`);
359
- }
360
- if (styles.listHoverForeground) {
361
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`);
362
- }
363
- if (styles.listSelectionOutline) {
364
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`);
365
- }
366
- if (styles.listFocusOutline) {
367
- content.push(`
368
- .monaco-drag-image,
369
- .monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }
370
- `);
371
- }
372
- if (styles.listInactiveFocusOutline) {
373
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`);
374
- }
375
- if (styles.listHoverOutline) {
376
- content.push(`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`);
377
- }
378
- if (styles.listDropOverBackground) {
379
- content.push(`
380
- .monaco-list${suffix}.drop-target,
381
- .monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows.drop-target,
382
- .monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-row.drop-target { background-color: ${styles.listDropOverBackground} !important; color: inherit !important; }
383
- `);
384
- }
385
- const newStyles = content.join('\n');
386
- if (newStyles !== this.styleElement.textContent) {
387
- this.styleElement.textContent = newStyles;
388
- }
389
- }
390
- };
391
- NotebookTextDiffList = ( __decorate([
392
- ( __param(6, IListService)),
393
- ( __param(7, IConfigurationService)),
394
- ( __param(8, IInstantiationService))
395
- ], NotebookTextDiffList));
396
-
397
- export { CellDiffSideBySideRenderer, CellDiffSingleSideRenderer, NotebookCellTextDiffListDelegate, NotebookMouseController, NotebookTextDiffList };
@@ -1,186 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { getWindow, addStandardDisposableListener, EventType, runAtThisOrScheduleAtNextAnimationFrame } from 'vscode/vscode/vs/base/browser/dom';
3
- import { createFastDomNode } from 'vscode/vscode/vs/base/browser/fastDomNode';
4
- import { PixelRatio } from 'vscode/vscode/vs/base/browser/pixelRatio';
5
- import { Color } from 'vscode/vscode/vs/base/common/color';
6
- import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
7
- import 'vscode/vscode/vs/platform/theme/common/colorUtils';
8
- import 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
9
- import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
10
- import { diffOverviewRulerInserted, diffInserted, defaultInsertColor, diffOverviewRulerRemoved, diffRemoved, defaultRemoveColor } from 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
11
- import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
12
- import 'vscode/vscode/vs/platform/theme/common/colors/listColors';
13
- import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
14
- import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
15
- import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
16
- import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
17
- import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
18
- import { Themable } from 'vscode/vscode/vs/platform/theme/common/themeService';
19
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
20
-
21
- const MINIMUM_SLIDER_SIZE = 20;
22
- let NotebookDiffOverviewRuler = class NotebookDiffOverviewRuler extends Themable {
23
- constructor(notebookEditor, width, container, themeService) {
24
- super(themeService);
25
- this.notebookEditor = notebookEditor;
26
- this.width = width;
27
- this._diffElementViewModels = [];
28
- this._lanes = 2;
29
- this._insertColor = null;
30
- this._removeColor = null;
31
- this._insertColorHex = null;
32
- this._removeColorHex = null;
33
- this._disposables = this._register(( new DisposableStore()));
34
- this._renderAnimationFrame = null;
35
- this._domNode = createFastDomNode(document.createElement('canvas'));
36
- this._domNode.setPosition('relative');
37
- this._domNode.setLayerHinting(true);
38
- this._domNode.setContain('strict');
39
- container.appendChild(this._domNode.domNode);
40
- this._overviewViewportDomElement = createFastDomNode(document.createElement('div'));
41
- this._overviewViewportDomElement.setClassName('diffViewport');
42
- this._overviewViewportDomElement.setPosition('absolute');
43
- this._overviewViewportDomElement.setWidth(width);
44
- container.appendChild(this._overviewViewportDomElement.domNode);
45
- this._register(PixelRatio.getInstance(getWindow(this._domNode.domNode)).onDidChange(() => {
46
- this._scheduleRender();
47
- }));
48
- this._register(this.themeService.onDidColorThemeChange(e => {
49
- const colorChanged = this.applyColors(e);
50
- if (colorChanged) {
51
- this._scheduleRender();
52
- }
53
- }));
54
- this.applyColors(this.themeService.getColorTheme());
55
- this._register(this.notebookEditor.onDidScroll(() => {
56
- this._renderOverviewViewport();
57
- }));
58
- this._register(addStandardDisposableListener(container, EventType.POINTER_DOWN, (e) => {
59
- this.notebookEditor.delegateVerticalScrollbarPointerDown(e);
60
- }));
61
- }
62
- applyColors(theme) {
63
- const newInsertColor = theme.getColor(diffOverviewRulerInserted) || ( (theme.getColor(diffInserted) || defaultInsertColor).transparent(2));
64
- const newRemoveColor = theme.getColor(diffOverviewRulerRemoved) || ( (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2));
65
- const hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor);
66
- this._insertColor = newInsertColor;
67
- this._removeColor = newRemoveColor;
68
- if (this._insertColor) {
69
- this._insertColorHex = Color.Format.CSS.formatHexA(this._insertColor);
70
- }
71
- if (this._removeColor) {
72
- this._removeColorHex = Color.Format.CSS.formatHexA(this._removeColor);
73
- }
74
- return hasChanges;
75
- }
76
- layout() {
77
- this._layoutNow();
78
- }
79
- updateViewModels(elements, eventDispatcher) {
80
- this._disposables.clear();
81
- this._diffElementViewModels = elements;
82
- if (eventDispatcher) {
83
- this._disposables.add(eventDispatcher.onDidChangeLayout(() => {
84
- this._scheduleRender();
85
- }));
86
- this._disposables.add(eventDispatcher.onDidChangeCellLayout(() => {
87
- this._scheduleRender();
88
- }));
89
- }
90
- this._scheduleRender();
91
- }
92
- _scheduleRender() {
93
- if (this._renderAnimationFrame === null) {
94
- this._renderAnimationFrame = runAtThisOrScheduleAtNextAnimationFrame(getWindow(this._domNode.domNode), this._onRenderScheduled.bind(this), 16);
95
- }
96
- }
97
- _onRenderScheduled() {
98
- this._renderAnimationFrame = null;
99
- this._layoutNow();
100
- }
101
- _layoutNow() {
102
- const layoutInfo = this.notebookEditor.getLayoutInfo();
103
- const height = layoutInfo.height;
104
- const contentHeight = ( this._diffElementViewModels.map(view => view.layoutInfo.totalHeight)).reduce((a, b) => a + b, 0);
105
- const ratio = PixelRatio.getInstance(getWindow(this._domNode.domNode)).value;
106
- this._domNode.setWidth(this.width);
107
- this._domNode.setHeight(height);
108
- this._domNode.domNode.width = this.width * ratio;
109
- this._domNode.domNode.height = height * ratio;
110
- const ctx = this._domNode.domNode.getContext('2d');
111
- ctx.clearRect(0, 0, this.width * ratio, height * ratio);
112
- this._renderCanvas(ctx, this.width * ratio, height * ratio, contentHeight * ratio, ratio);
113
- this._renderOverviewViewport();
114
- }
115
- _renderOverviewViewport() {
116
- const layout = this._computeOverviewViewport();
117
- if (!layout) {
118
- this._overviewViewportDomElement.setTop(0);
119
- this._overviewViewportDomElement.setHeight(0);
120
- }
121
- else {
122
- this._overviewViewportDomElement.setTop(layout.top);
123
- this._overviewViewportDomElement.setHeight(layout.height);
124
- }
125
- }
126
- _computeOverviewViewport() {
127
- const layoutInfo = this.notebookEditor.getLayoutInfo();
128
- if (!layoutInfo) {
129
- return null;
130
- }
131
- const scrollTop = this.notebookEditor.getScrollTop();
132
- const scrollHeight = this.notebookEditor.getScrollHeight();
133
- const computedAvailableSize = Math.max(0, layoutInfo.height);
134
- const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0);
135
- const visibleSize = layoutInfo.height;
136
- const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollHeight)));
137
- const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollHeight - visibleSize);
138
- const computedSliderPosition = Math.round(scrollTop * computedSliderRatio);
139
- return {
140
- height: computedSliderSize,
141
- top: computedSliderPosition
142
- };
143
- }
144
- _renderCanvas(ctx, width, height, scrollHeight, ratio) {
145
- if (!this._insertColorHex || !this._removeColorHex) {
146
- return;
147
- }
148
- const laneWidth = width / this._lanes;
149
- let currentFrom = 0;
150
- for (let i = 0; i < this._diffElementViewModels.length; i++) {
151
- const element = this._diffElementViewModels[i];
152
- const cellHeight = Math.round((element.layoutInfo.totalHeight / scrollHeight) * ratio * height);
153
- switch (element.type) {
154
- case 'insert':
155
- ctx.fillStyle = this._insertColorHex;
156
- ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
157
- break;
158
- case 'delete':
159
- ctx.fillStyle = this._removeColorHex;
160
- ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
161
- break;
162
- case 'unchanged':
163
- break;
164
- case 'modified':
165
- ctx.fillStyle = this._removeColorHex;
166
- ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
167
- ctx.fillStyle = this._insertColorHex;
168
- ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
169
- break;
170
- }
171
- currentFrom += cellHeight;
172
- }
173
- }
174
- dispose() {
175
- if (this._renderAnimationFrame !== null) {
176
- this._renderAnimationFrame.dispose();
177
- this._renderAnimationFrame = null;
178
- }
179
- super.dispose();
180
- }
181
- };
182
- NotebookDiffOverviewRuler = ( __decorate([
183
- ( __param(3, IThemeService))
184
- ], NotebookDiffOverviewRuler));
185
-
186
- export { NotebookDiffOverviewRuler };