@codingame/monaco-vscode-api 33.0.3 → 33.0.4

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 (52) hide show
  1. package/package.json +9 -9
  2. package/services.js +3 -3
  3. package/vscode/src/vs/platform/product/common/product.js +1 -1
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -746
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -300
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1963
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -314
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -886
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -118
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -71
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -313
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -265
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -185
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -104
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -43
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -41
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -69
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -933
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -32
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -643
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -197
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -539
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
  49. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
  50. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -90
  51. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
  52. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
@@ -1,197 +0,0 @@
1
-
2
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
3
- import { createElement, getWindow, addStandardDisposableListener, EventType, runAtThisOrScheduleAtNextAnimationFrame } from '../../../../../base/browser/dom.js';
4
- import { createFastDomNode } from '../../../../../base/browser/fastDomNode.js';
5
- import { PixelRatio } from '../../../../../base/browser/pixelRatio.js';
6
- import { Color } from '../../../../../base/common/color.js';
7
- import { DisposableStore } from '../../../../../base/common/lifecycle.js';
8
- import '../../../../../platform/theme/common/colorUtils.js';
9
- import '../../../../../platform/theme/common/colors/baseColors.js';
10
- import '../../../../../platform/theme/common/colors/chartsColors.js';
11
- import { diffOverviewRulerInserted, defaultInsertColor, diffInserted, diffOverviewRulerRemoved, defaultRemoveColor, diffRemoved } from '../../../../../platform/theme/common/colors/editorColors.js';
12
- import '../../../../../platform/theme/common/colors/inputColors.js';
13
- import '../../../../../platform/theme/common/colors/listColors.js';
14
- import '../../../../../platform/theme/common/colors/menuColors.js';
15
- import '../../../../../platform/theme/common/colors/minimapColors.js';
16
- import '../../../../../platform/theme/common/colors/miscColors.js';
17
- import '../../../../../platform/theme/common/colors/quickpickColors.js';
18
- import '../../../../../platform/theme/common/colors/searchColors.js';
19
- import { Themable } from '../../../../../platform/theme/common/themeService.js';
20
- import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
21
-
22
- const MINIMUM_SLIDER_SIZE = 20;
23
- let NotebookDiffOverviewRuler = class NotebookDiffOverviewRuler extends Themable {
24
- constructor(notebookEditor, width, container, themeService) {
25
- super(themeService);
26
- this.notebookEditor = notebookEditor;
27
- this.width = width;
28
- this._diffElementViewModels = [];
29
- this._lanes = 2;
30
- this._insertColor = null;
31
- this._removeColor = null;
32
- this._insertColorHex = null;
33
- this._removeColorHex = null;
34
- this._disposables = this._register(( new DisposableStore()));
35
- this._renderAnimationFrame = null;
36
- this._domNode = createFastDomNode(createElement("canvas"));
37
- this._domNode.setPosition("relative");
38
- this._domNode.setLayerHinting(true);
39
- this._domNode.setContain("strict");
40
- container.appendChild(this._domNode.domNode);
41
- this._overviewViewportDomElement = createFastDomNode(createElement("div"));
42
- this._overviewViewportDomElement.setClassName("diffViewport");
43
- this._overviewViewportDomElement.setPosition("absolute");
44
- this._overviewViewportDomElement.setWidth(width);
45
- container.appendChild(this._overviewViewportDomElement.domNode);
46
- this._register(
47
- PixelRatio.getInstance(getWindow(this._domNode.domNode)).onDidChange(() => {
48
- this._scheduleRender();
49
- })
50
- );
51
- this._register(this.themeService.onDidColorThemeChange(e => {
52
- const colorChanged = this.applyColors(e);
53
- if (colorChanged) {
54
- this._scheduleRender();
55
- }
56
- }));
57
- this.applyColors(this.themeService.getColorTheme());
58
- this._register(this.notebookEditor.onDidScroll(() => {
59
- this._renderOverviewViewport();
60
- }));
61
- this._register(
62
- addStandardDisposableListener(container, EventType.POINTER_DOWN, e => {
63
- this.notebookEditor.delegateVerticalScrollbarPointerDown(e);
64
- })
65
- );
66
- }
67
- applyColors(theme) {
68
- const newInsertColor = theme.getColor(diffOverviewRulerInserted) || ( (theme.getColor(diffInserted) || defaultInsertColor).transparent(2));
69
- const newRemoveColor = theme.getColor(diffOverviewRulerRemoved) || ( (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2));
70
- const hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor);
71
- this._insertColor = newInsertColor;
72
- this._removeColor = newRemoveColor;
73
- if (this._insertColor) {
74
- this._insertColorHex = Color.Format.CSS.formatHexA(this._insertColor);
75
- }
76
- if (this._removeColor) {
77
- this._removeColorHex = Color.Format.CSS.formatHexA(this._removeColor);
78
- }
79
- return hasChanges;
80
- }
81
- layout() {
82
- this._layoutNow();
83
- }
84
- updateViewModels(elements, eventDispatcher) {
85
- this._disposables.clear();
86
- this._diffElementViewModels = elements;
87
- if (eventDispatcher) {
88
- this._disposables.add(eventDispatcher.onDidChangeLayout(() => {
89
- this._scheduleRender();
90
- }));
91
- this._disposables.add(eventDispatcher.onDidChangeCellLayout(() => {
92
- this._scheduleRender();
93
- }));
94
- }
95
- this._scheduleRender();
96
- }
97
- _scheduleRender() {
98
- if (this._renderAnimationFrame === null) {
99
- this._renderAnimationFrame = runAtThisOrScheduleAtNextAnimationFrame(
100
- getWindow(this._domNode.domNode),
101
- this._onRenderScheduled.bind(this),
102
- 16
103
- );
104
- }
105
- }
106
- _onRenderScheduled() {
107
- this._renderAnimationFrame = null;
108
- this._layoutNow();
109
- }
110
- _layoutNow() {
111
- const layoutInfo = this.notebookEditor.getLayoutInfo();
112
- const height = layoutInfo.height;
113
- const contentHeight = ( this._diffElementViewModels.map(view => view.totalHeight)).reduce((a, b) => a + b, 0);
114
- const ratio = PixelRatio.getInstance(getWindow(this._domNode.domNode)).value;
115
- this._domNode.setWidth(this.width);
116
- this._domNode.setHeight(height);
117
- this._domNode.domNode.width = this.width * ratio;
118
- this._domNode.domNode.height = height * ratio;
119
- const ctx = this._domNode.domNode.getContext("2d");
120
- ctx.clearRect(0, 0, this.width * ratio, height * ratio);
121
- this._renderCanvas(ctx, this.width * ratio, height * ratio, contentHeight * ratio, ratio);
122
- this._renderOverviewViewport();
123
- }
124
- _renderOverviewViewport() {
125
- const layout = this._computeOverviewViewport();
126
- if (!layout) {
127
- this._overviewViewportDomElement.setTop(0);
128
- this._overviewViewportDomElement.setHeight(0);
129
- } else {
130
- this._overviewViewportDomElement.setTop(layout.top);
131
- this._overviewViewportDomElement.setHeight(layout.height);
132
- }
133
- }
134
- _computeOverviewViewport() {
135
- const layoutInfo = this.notebookEditor.getLayoutInfo();
136
- if (!layoutInfo) {
137
- return null;
138
- }
139
- const scrollTop = this.notebookEditor.getScrollTop();
140
- const scrollHeight = this.notebookEditor.getScrollHeight();
141
- const computedAvailableSize = Math.max(0, layoutInfo.height);
142
- const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0);
143
- const visibleSize = layoutInfo.height;
144
- const computedSliderSize = Math.round(Math.max(
145
- MINIMUM_SLIDER_SIZE,
146
- Math.floor(visibleSize * computedRepresentableSize / scrollHeight)
147
- ));
148
- const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollHeight - visibleSize);
149
- const computedSliderPosition = Math.round(scrollTop * computedSliderRatio);
150
- return {
151
- height: computedSliderSize,
152
- top: computedSliderPosition
153
- };
154
- }
155
- _renderCanvas(ctx, width, height, scrollHeight, ratio) {
156
- if (!this._insertColorHex || !this._removeColorHex) {
157
- return;
158
- }
159
- const laneWidth = width / this._lanes;
160
- let currentFrom = 0;
161
- for (let i = 0; i < this._diffElementViewModels.length; i++) {
162
- const element = this._diffElementViewModels[i];
163
- const cellHeight = Math.round((element.totalHeight / scrollHeight) * ratio * height);
164
- switch (element.type) {
165
- case "insert":
166
- ctx.fillStyle = this._insertColorHex;
167
- ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
168
- break;
169
- case "delete":
170
- ctx.fillStyle = this._removeColorHex;
171
- ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
172
- break;
173
- case "unchanged":
174
- case "unchangedMetadata":
175
- break;
176
- case "modified":
177
- case "modifiedMetadata":
178
- ctx.fillStyle = this._removeColorHex;
179
- ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
180
- ctx.fillStyle = this._insertColorHex;
181
- ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
182
- break;
183
- }
184
- currentFrom += cellHeight;
185
- }
186
- }
187
- dispose() {
188
- if (this._renderAnimationFrame !== null) {
189
- this._renderAnimationFrame.dispose();
190
- this._renderAnimationFrame = null;
191
- }
192
- super.dispose();
193
- }
194
- };
195
- NotebookDiffOverviewRuler = ( __decorate([( __param(3, IThemeService))], NotebookDiffOverviewRuler));
196
-
197
- export { NotebookDiffOverviewRuler };
@@ -1,75 +0,0 @@
1
- import { CancellationToken } from "../../../../../base/common/cancellation.js";
2
- import { IDiffResult } from "../../../../../base/common/diff/diff.js";
3
- import { type IValueWithChangeEvent } from "../../../../../base/common/event.js";
4
- import { Disposable } from "../../../../../base/common/lifecycle.js";
5
- import type { URI } from "../../../../../base/common/uri.js";
6
- import { FontInfo } from "../../../../../editor/common/config/fontInfo.js";
7
- import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js";
8
- import type { ContextKeyValue } from "../../../../../platform/contextkey/common/contextkey.js";
9
- import { MultiDiffEditorItem } from "../../../multiDiffEditor/browser/multiDiffSourceResolverService.js";
10
- import { IDiffElementViewModelBase } from "./diffElementViewModel.js";
11
- import { NotebookDiffEditorEventDispatcher } from "./eventDispatcher.js";
12
- import { INotebookDiffViewModel, INotebookDiffViewModelUpdateEvent } from "./notebookDiffEditorBrowser.js";
13
- import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
14
- import { INotebookDiffEditorModel } from "../../common/notebookCommon.js";
15
- import { INotebookService } from "../../common/notebookService.service.js";
16
- import { INotebookEditorWorkerService } from "../../common/services/notebookWorkerService.service.js";
17
- import { IDiffEditorHeightCalculatorService } from "./editorHeightCalculator.js";
18
- export declare class NotebookDiffViewModel extends Disposable implements INotebookDiffViewModel, IValueWithChangeEvent<readonly MultiDiffEditorItem[]> {
19
- private readonly model;
20
- private readonly notebookEditorWorkerService;
21
- private readonly configurationService;
22
- private readonly eventDispatcher;
23
- private readonly notebookService;
24
- private readonly diffEditorHeightCalculator;
25
- private readonly fontInfo?;
26
- private readonly excludeUnchangedPlaceholder?;
27
- private readonly placeholderAndRelatedCells;
28
- private readonly _items;
29
- get items(): readonly IDiffElementViewModelBase[];
30
- private readonly _onDidChangeItems;
31
- readonly onDidChangeItems: import("../../../../../base/common/event.js").Event<INotebookDiffViewModelUpdateEvent>;
32
- private readonly disposables;
33
- private _onDidChange;
34
- private diffEditorItems;
35
- onDidChange: import("../../../../../base/common/event.js").Event<void>;
36
- private notebookMetadataViewModel?;
37
- get value(): readonly NotebookMultiDiffEditorItem[];
38
- private _hasUnchangedCells?;
39
- get hasUnchangedCells(): boolean;
40
- private _includeUnchanged?;
41
- get includeUnchanged(): boolean;
42
- set includeUnchanged(value: boolean);
43
- private hideOutput?;
44
- private ignoreMetadata?;
45
- private originalCellViewModels;
46
- constructor(model: INotebookDiffEditorModel, notebookEditorWorkerService: INotebookEditorWorkerService, configurationService: IConfigurationService, eventDispatcher: NotebookDiffEditorEventDispatcher, notebookService: INotebookService, diffEditorHeightCalculator: IDiffEditorHeightCalculatorService, fontInfo?: FontInfo | undefined, excludeUnchangedPlaceholder?: boolean | undefined);
47
- dispose(): void;
48
- private clear;
49
- computeDiff(token: CancellationToken): Promise<void>;
50
- private toggleNotebookMetadata;
51
- private updateDiffEditorItems;
52
- private updateViewModels;
53
- private createDiffViewModels;
54
- }
55
- /**
56
- * making sure that swapping cells are always translated to `insert+delete`.
57
- */
58
- export declare function prettyChanges(original: NotebookTextModel, modified: NotebookTextModel, diffResult: IDiffResult): void;
59
- export type CellDiffInfo = {
60
- originalCellIndex: number;
61
- modifiedCellIndex: number;
62
- type: "unchanged" | "modified";
63
- } | {
64
- originalCellIndex: number;
65
- type: "delete";
66
- } | {
67
- modifiedCellIndex: number;
68
- type: "insert";
69
- };
70
- export declare abstract class NotebookMultiDiffEditorItem extends MultiDiffEditorItem {
71
- readonly type: IDiffElementViewModelBase["type"];
72
- readonly containerType: IDiffElementViewModelBase["type"];
73
- kind: "Cell" | "Metadata" | "Output";
74
- constructor(originalUri: URI | undefined, modifiedUri: URI | undefined, goToFileUri: URI | undefined, type: IDiffElementViewModelBase["type"], containerType: IDiffElementViewModelBase["type"], kind: "Cell" | "Metadata" | "Output", contextKeys?: Record<string, ContextKeyValue>);
75
- }