@codingame/monaco-vscode-api 1.83.9 → 1.83.10-next.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/monaco.js CHANGED
@@ -2,7 +2,7 @@ import { __decorate, __param } from './external/tslib/tslib.es6.js';
2
2
  import { StandaloneServices, StandaloneKeybindingService } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
3
3
  import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
4
4
  import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
5
- import { StandaloneDiffEditor2, StandaloneEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
5
+ import { StandaloneEditor, StandaloneDiffEditor2 } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
6
6
  import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
7
7
  import { distinct, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
8
8
  export { errorHandler } from 'monaco-editor/esm/vs/base/common/errors.js';
@@ -66,25 +66,40 @@ ExtensionPoints = __decorate([
66
66
  ( __param(0, IInstantiationService))
67
67
  ], ExtensionPoints);
68
68
  ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(ExtensionPoints, 1 );
69
- function computeConfiguration(configuration, isDiffEditor, overrides) {
69
+ function computeConfiguration(configuration, overrides) {
70
70
  const editorConfiguration = isObject(configuration.editor) ? deepClone(configuration.editor) : Object.create(null);
71
- if (isDiffEditor && isObject(configuration.diffEditor)) {
72
- Object.assign(editorConfiguration, deepClone(configuration.diffEditor));
71
+ Object.assign(editorConfiguration, deepClone(overrides));
72
+ return editorConfiguration;
73
+ }
74
+ function computeDiffConfiguration(configuration, overrides) {
75
+ const editorConfiguration = computeConfiguration(configuration);
76
+ if (isObject(configuration.diffEditor)) {
77
+ const diffEditorConfiguration = deepClone(configuration.diffEditor);
78
+ diffEditorConfiguration.diffCodeLens = diffEditorConfiguration.codeLens;
79
+ delete diffEditorConfiguration.codeLens;
80
+ diffEditorConfiguration.diffWordWrap = diffEditorConfiguration.wordWrap;
81
+ delete diffEditorConfiguration.wordWrap;
82
+ Object.assign(editorConfiguration, diffEditorConfiguration);
73
83
  }
84
+ editorConfiguration.accessibilityVerbose = configuration.accessibility?.verbosity?.diffEditor ?? false;
74
85
  Object.assign(editorConfiguration, deepClone(overrides));
75
86
  return editorConfiguration;
76
87
  }
77
88
  let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends createInjectedClass(StandaloneEditor) {
78
- constructor(domElement, isDiffEditor, _options = {}, instantiationService, textResourceConfigurationService) {
89
+ constructor(domElement, _options = {}, instantiationService, textResourceConfigurationService) {
79
90
  const { theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement, overflowWidgetsDomNode, dimension, ...options } = _options;
80
- const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options.model?.uri), isDiffEditor, options);
91
+ const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options.model?.uri), options);
81
92
  super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement });
82
- this.isDiffEditor = isDiffEditor;
83
93
  this.textResourceConfigurationService = textResourceConfigurationService;
84
94
  this.optionsOverrides = {};
85
95
  this.lastAppliedEditorOptions = computedOptions;
86
96
  this.optionsOverrides = options;
87
- this._register(textResourceConfigurationService.onDidChangeConfiguration(() => this.updateEditorConfiguration()));
97
+ this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => {
98
+ const resource = this.getModel()?.uri;
99
+ if (resource != null && e.affectsConfiguration(resource, 'editor')) {
100
+ this.updateEditorConfiguration();
101
+ }
102
+ }));
88
103
  this._register(this.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
89
104
  this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
90
105
  this.updateEditorConfiguration();
@@ -98,7 +113,7 @@ let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends create
98
113
  if (configuration == null) {
99
114
  return;
100
115
  }
101
- const editorConfiguration = computeConfiguration(configuration, this.isDiffEditor, this.optionsOverrides);
116
+ const editorConfiguration = computeConfiguration(configuration, this.optionsOverrides);
102
117
  let editorSettingsToApply = editorConfiguration;
103
118
  if (this.lastAppliedEditorOptions != null) {
104
119
  editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
@@ -118,14 +133,63 @@ let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends create
118
133
  }
119
134
  };
120
135
  ConfiguredStandaloneEditor = __decorate([
121
- ( __param(3, IInstantiationService)),
122
- ( __param(4, ITextResourceConfigurationService))
136
+ ( __param(2, IInstantiationService)),
137
+ ( __param(3, ITextResourceConfigurationService))
123
138
  ], ConfiguredStandaloneEditor);
124
- class ConfiguredStandaloneDiffEditor extends StandaloneDiffEditor2 {
139
+ let ConfiguredStandaloneDiffEditor = class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffEditor2) {
140
+ constructor(domElement, _options = {}, instantiationService, textResourceConfigurationService) {
141
+ const { theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel, overflowWidgetsDomNode, dimension, ...options } = _options;
142
+ const computedOptions = computeDiffConfiguration(textResourceConfigurationService.getValue(undefined), options);
143
+ super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel });
144
+ this.textResourceConfigurationService = textResourceConfigurationService;
145
+ this.optionsOverrides = {};
146
+ this.lastAppliedEditorOptions = computedOptions;
147
+ this.optionsOverrides = options;
148
+ this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => {
149
+ const resource = this._targetEditor.getModel()?.uri;
150
+ if (resource != null && (e.affectsConfiguration(resource, 'editor') || e.affectsConfiguration(resource, 'diffEditor') || e.affectsConfiguration(resource, 'accessibility.verbosity.diffEditor'))) {
151
+ this.updateEditorConfiguration();
152
+ }
153
+ }));
154
+ this._register(this._targetEditor.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
155
+ this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
156
+ this.updateEditorConfiguration();
157
+ }
158
+ updateEditorConfiguration() {
159
+ if (this.getModel() == null || this.textResourceConfigurationService == null) {
160
+ return;
161
+ }
162
+ const resource = this._targetEditor.getModel()?.uri;
163
+ const configuration = this.textResourceConfigurationService.getValue(resource);
164
+ if (configuration == null) {
165
+ return;
166
+ }
167
+ const editorConfiguration = computeDiffConfiguration(configuration, this.optionsOverrides);
168
+ let editorSettingsToApply = editorConfiguration;
169
+ if (this.lastAppliedEditorOptions != null) {
170
+ editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
171
+ }
172
+ if (( Object.keys(editorSettingsToApply)).length > 0) {
173
+ this.lastAppliedEditorOptions = editorConfiguration;
174
+ super.updateOptions(editorSettingsToApply);
175
+ }
176
+ }
177
+ updateOptions(newOptions) {
178
+ this.optionsOverrides ?? (this.optionsOverrides = {});
179
+ this.optionsOverrides = {
180
+ ...this.optionsOverrides,
181
+ ...newOptions
182
+ };
183
+ this.updateEditorConfiguration();
184
+ }
125
185
  _createInnerEditor(instantiationService, container, options) {
126
- return instantiationService.createInstance(ConfiguredStandaloneEditor, container, true, options);
186
+ return instantiationService.createInstance(ConfiguredStandaloneEditor, container, options);
127
187
  }
128
- }
188
+ };
189
+ ConfiguredStandaloneDiffEditor = __decorate([
190
+ ( __param(2, IInstantiationService)),
191
+ ( __param(3, ITextResourceConfigurationService))
192
+ ], ConfiguredStandaloneDiffEditor);
129
193
  async function writeFile(uri, content) {
130
194
  await StandaloneServices.get(IFileService).writeFile(uri, VSBuffer.fromString(content));
131
195
  }
@@ -190,7 +254,7 @@ function getStandaloneEditorInstantiationService() {
190
254
  }
191
255
  const createConfiguredEditor = (domElement, options, override) => {
192
256
  StandaloneServices.initialize(override ?? {});
193
- return getStandaloneEditorInstantiationService().createInstance(ConfiguredStandaloneEditor, domElement, false, options);
257
+ return getStandaloneEditorInstantiationService().createInstance(ConfiguredStandaloneEditor, domElement, options);
194
258
  };
195
259
  const createConfiguredDiffEditor = (domElement, options, override) => {
196
260
  StandaloneServices.initialize(override ?? {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "1.83.9",
3
+ "version": "1.83.10-next.0",
4
4
  "description": "VSCode public API plugged on the monaco editor",
5
5
  "keywords": [],
6
6
  "author": {
@@ -96,10 +96,10 @@
96
96
  "dependencies": {
97
97
  "monaco-editor": "0.44.0",
98
98
  "vscode-semver": "npm:semver@=5.5.0",
99
- "@codingame/monaco-vscode-extensions-service-override": "1.83.9",
100
- "@codingame/monaco-vscode-files-service-override": "1.83.9",
101
- "@codingame/monaco-vscode-layout-service-override": "1.83.9",
102
- "@codingame/monaco-vscode-environment-service-override": "1.83.9",
103
- "@codingame/monaco-vscode-quickaccess-service-override": "1.83.9"
99
+ "@codingame/monaco-vscode-extensions-service-override": "1.83.10-next.0",
100
+ "@codingame/monaco-vscode-files-service-override": "1.83.10-next.0",
101
+ "@codingame/monaco-vscode-layout-service-override": "1.83.10-next.0",
102
+ "@codingame/monaco-vscode-environment-service-override": "1.83.10-next.0",
103
+ "@codingame/monaco-vscode-quickaccess-service-override": "1.83.10-next.0"
104
104
  }
105
105
  }
@@ -14,7 +14,7 @@ let ExtensionResourceLoaderService = class ExtensionResourceLoaderService extend
14
14
  }
15
15
  async readExtensionResource(uri) {
16
16
  uri = FileAccess.uriToBrowserUri(uri);
17
- if (uri.scheme !== Schemas.http && uri.scheme !== Schemas.https) {
17
+ if (uri.scheme !== Schemas.http && uri.scheme !== Schemas.https && uri.scheme !== Schemas.data) {
18
18
  const result = await this._fileService.readFile(uri);
19
19
  return ( result.value.toString());
20
20
  }
@@ -3,8 +3,8 @@ import { IExtensionManagementService } from '../../../../platform/extensionManag
3
3
  import { FileAccess } from 'monaco-editor/esm/vs/base/common/network.js';
4
4
  const IProfileAwareExtensionManagementService = refineServiceDecorator(IExtensionManagementService);
5
5
  const IExtensionManagementServerService = ( createDecorator('extensionManagementServerService'));
6
- const DefaultIconPath = ( ( FileAccess.asBrowserUri('vs/workbench/services/extensionManagement/common/media/defaultIcon.png')).toString(true));
6
+ const getDefaultIconPath = () => ( ( FileAccess.asBrowserUri('vs/workbench/services/extensionManagement/common/media/defaultIcon.png')).toString(true));
7
7
  const IWorkbenchExtensionManagementService = refineServiceDecorator(IProfileAwareExtensionManagementService);
8
8
  const IWorkbenchExtensionEnablementService = ( createDecorator('extensionEnablementService'));
9
9
  const IWebExtensionsScannerService = ( createDecorator('IWebExtensionsScannerService'));
10
- export { DefaultIconPath, IExtensionManagementServerService, IProfileAwareExtensionManagementService, IWebExtensionsScannerService, IWorkbenchExtensionEnablementService, IWorkbenchExtensionManagementService };
10
+ export { IExtensionManagementServerService, IProfileAwareExtensionManagementService, IWebExtensionsScannerService, IWorkbenchExtensionEnablementService, IWorkbenchExtensionManagementService, getDefaultIconPath };