@codingame/monaco-vscode-api 1.67.16 → 1.67.19

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/dist/monaco.js ADDED
@@ -0,0 +1,149 @@
1
+ import { b as __decorate, c as __param } from './tslib.es6-16b40665.js';
2
+ import { _util, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
3
+ import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
4
+ import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
5
+ import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
6
+ import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
7
+ import { StandaloneEditor, StandaloneDiffEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
8
+ function equals(one, other) {
9
+ if (one === other) {
10
+ return true;
11
+ }
12
+ if (one === null || one === undefined || other === null || other === undefined) {
13
+ return false;
14
+ }
15
+ if (typeof one !== typeof other) {
16
+ return false;
17
+ }
18
+ if (typeof one !== 'object') {
19
+ return false;
20
+ }
21
+ if ((Array.isArray(one)) !== (Array.isArray(other))) {
22
+ return false;
23
+ }
24
+ let i;
25
+ let key;
26
+ if (Array.isArray(one)) {
27
+ if (one.length !== other.length) {
28
+ return false;
29
+ }
30
+ for (i = 0; i < one.length; i++) {
31
+ if (!equals(one[i], other[i])) {
32
+ return false;
33
+ }
34
+ }
35
+ }
36
+ else {
37
+ const oneKeys = [];
38
+ for (key in one) {
39
+ oneKeys.push(key);
40
+ }
41
+ oneKeys.sort();
42
+ const otherKeys = [];
43
+ for (key in other) {
44
+ otherKeys.push(key);
45
+ }
46
+ otherKeys.sort();
47
+ if (!equals(oneKeys, otherKeys)) {
48
+ return false;
49
+ }
50
+ for (i = 0; i < oneKeys.length; i++) {
51
+ if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {
52
+ return false;
53
+ }
54
+ }
55
+ }
56
+ return true;
57
+ }
58
+ function distinct(base, target) {
59
+ const result = Object.create(null);
60
+ if (!base || !target) {
61
+ return result;
62
+ }
63
+ const targetKeys = Object.keys(target);
64
+ targetKeys.forEach(k => {
65
+ const baseValue = base[k];
66
+ const targetValue = target[k];
67
+ if (!equals(baseValue, targetValue)) {
68
+ result[k] = targetValue;
69
+ }
70
+ });
71
+ return result;
72
+ }
73
+ function getInjectedParameters(instantiationService, ctor) {
74
+ return instantiationService.invokeFunction((accessor) => {
75
+ return _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index).map(d => accessor.get(d.id));
76
+ });
77
+ }
78
+ function createInjectedClass(ctor) {
79
+ const _ctor = ctor;
80
+ return class extends _ctor {
81
+ constructor(...args) {
82
+ super(...args.slice(1), ...getInjectedParameters(args[0], ctor));
83
+ }
84
+ };
85
+ }
86
+ function computeConfiguration(configuration, isDiffEditor, overrides) {
87
+ const editorConfiguration = isObject(configuration.editor) ? deepClone(configuration.editor) : Object.create(null);
88
+ if (isDiffEditor && isObject(configuration.diffEditor)) {
89
+ Object.assign(editorConfiguration, configuration.diffEditor);
90
+ }
91
+ if (isObject(configuration.diffEditor)) {
92
+ Object.assign(editorConfiguration, overrides);
93
+ }
94
+ return editorConfiguration;
95
+ }
96
+ let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends createInjectedClass(StandaloneEditor) {
97
+ constructor(domElement, isDiffEditor, _options, instantiationService, textResourceConfigurationService) {
98
+ const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options?.model?.uri), isDiffEditor, _options);
99
+ super(instantiationService, domElement, computedOptions);
100
+ this.isDiffEditor = isDiffEditor;
101
+ this.textResourceConfigurationService = textResourceConfigurationService;
102
+ this.lastAppliedEditorOptions = computedOptions;
103
+ this.optionsOverrides = _options;
104
+ this._register(textResourceConfigurationService.onDidChangeConfiguration(() => this.updateEditorConfiguration()));
105
+ this._register(this.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
106
+ this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
107
+ }
108
+ updateEditorConfiguration() {
109
+ const resource = this.getModel()?.uri;
110
+ if (resource == null) {
111
+ return;
112
+ }
113
+ const configuration = this.textResourceConfigurationService.getValue(resource);
114
+ if (configuration == null) {
115
+ return;
116
+ }
117
+ const editorConfiguration = computeConfiguration(configuration, this.isDiffEditor, this.optionsOverrides);
118
+ let editorSettingsToApply = editorConfiguration;
119
+ if (this.lastAppliedEditorOptions != null) {
120
+ editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
121
+ }
122
+ if (Object.keys(editorSettingsToApply).length > 0) {
123
+ this.lastAppliedEditorOptions = editorConfiguration;
124
+ super.updateOptions(editorSettingsToApply);
125
+ }
126
+ }
127
+ updateOptions(newOptions) {
128
+ this.optionsOverrides = newOptions;
129
+ this.updateEditorConfiguration();
130
+ }
131
+ };
132
+ ConfiguredStandaloneEditor = __decorate([
133
+ __param(3, IInstantiationService),
134
+ __param(4, ITextResourceConfigurationService)
135
+ ], ConfiguredStandaloneEditor);
136
+ class ConfiguredStandaloneDiffEditor extends StandaloneDiffEditor {
137
+ _createInnerEditor(instantiationService, container, options) {
138
+ return instantiationService.createInstance(ConfiguredStandaloneEditor, container, true, options);
139
+ }
140
+ }
141
+ const createConfiguredEditor = (domElement, options, override) => {
142
+ const instantiationService = StandaloneServices.initialize(override ?? {});
143
+ return instantiationService.createInstance(ConfiguredStandaloneEditor, domElement, false, options);
144
+ };
145
+ const createConfiguredDiffEditor = (domElement, options, override) => {
146
+ const instantiationService = StandaloneServices.initialize(override ?? {});
147
+ return instantiationService.createInstance(ConfiguredStandaloneDiffEditor, domElement, options);
148
+ };
149
+ export { createConfiguredDiffEditor, createConfiguredEditor };
@@ -0,0 +1,3 @@
1
+ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
2
+ const Position = monaco.Position;
3
+ export { Position as P };
@@ -1,5 +1,6 @@
1
1
  import { createDecorator, IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
2
2
  import { IEnvironmentService } from 'monaco-editor/esm/vs/platform/environment/common/environment.js';
3
+ import { b as __decorate, c as __param } from './tslib.es6-16b40665.js';
3
4
  import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
4
5
  import { isWindows, OS } from 'monaco-editor/esm/vs/base/common/platform.js';
5
6
  import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
@@ -379,26 +380,6 @@ class NoOpProgress {
379
380
  total(value) { }
380
381
  worked(value) { }
381
382
  }
382
- function __decorate(decorators, target, key, desc) {
383
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
384
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
385
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
386
- return c > 3 && r && Object.defineProperty(target, key, r), r;
387
- }
388
- function __param(paramIndex, decorator) {
389
- return function (target, key) { decorator(target, key, paramIndex); }
390
- }
391
- function __classPrivateFieldGet(receiver, state, kind, f) {
392
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
393
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
394
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
395
- }
396
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
397
- if (kind === "m") throw new TypeError("Private method is not writable");
398
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
399
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
400
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
401
- }
402
383
  const IFileService = createDecorator('fileService');
403
384
  var FileType;
404
385
  (function(FileType) {
@@ -1032,4 +1013,4 @@ var Services;
1032
1013
  }
1033
1014
  Services.install = install;
1034
1015
  })(Services || (Services = {}));
1035
- export { ACTIVE_GROUP as A, NeverShowAgainScope as B, CancellationTokenSource as C, isPreferredGroup as D, ensureFileSystemProviderError as E, FileSystemProviderErrorCode as F, createFileSystemProviderError as G, FileChangesEvent as H, IProgressService as I, FileOperationError as J, hasOpenReadWriteCloseCapability as K, hasReadWriteCapability as L, hasFileReadStreamCapability as M, NoOpNotification as N, toFileSystemProviderErrorCode as O, etag as P, FileOperationEvent as Q, toFileOperationResult as R, SIDE_GROUP as S, ETAG_DISABLED as T, hasFileAtomicReadCapability as U, NotModifiedSinceFileOperationError as V, hasFileFolderCopyCapability as W, __classPrivateFieldSet as _, __classPrivateFieldGet as a, __decorate as b, coalesceInPlace as c, __param as d, delta as e, mapArrayOrNot as f, ITextFileService as g, IFileService as h, IWorkbenchEnvironmentService as i, IUriIdentityService as j, IWorkingCopyFileService as k, IPathService as l, markAsFileSystemProviderError as m, disposed as n, IEditorService as o, IEditorGroupsService as p, IPaneCompositePartService as q, readonly as r, IProductService as s, ILanguageStatusService as t, IHostService as u, Services as v, FileType as w, FilePermission as x, NotificationsFilter as y, refineServiceDecorator as z };
1016
+ export { ACTIVE_GROUP as A, createFileSystemProviderError as B, CancellationTokenSource as C, FileChangesEvent as D, FileOperationError as E, FileSystemProviderErrorCode as F, hasOpenReadWriteCloseCapability as G, hasReadWriteCapability as H, IProgressService as I, hasFileReadStreamCapability as J, toFileSystemProviderErrorCode as K, etag as L, FileOperationEvent as M, NoOpNotification as N, toFileOperationResult as O, ETAG_DISABLED as P, hasFileAtomicReadCapability as Q, NotModifiedSinceFileOperationError as R, SIDE_GROUP as S, hasFileFolderCopyCapability as T, mapArrayOrNot as a, ITextFileService as b, coalesceInPlace as c, delta as d, IFileService as e, IWorkbenchEnvironmentService as f, IUriIdentityService as g, IWorkingCopyFileService as h, IPathService as i, disposed as j, IEditorService as k, IEditorGroupsService as l, markAsFileSystemProviderError as m, IPaneCompositePartService as n, IProductService as o, ILanguageStatusService as p, IHostService as q, readonly as r, Services as s, FileType as t, FilePermission as u, NotificationsFilter as v, refineServiceDecorator as w, NeverShowAgainScope as x, isPreferredGroup as y, ensureFileSystemProviderError as z };
package/dist/services.js CHANGED
@@ -1,4 +1,4 @@
1
- export { p as IEditorGroupsService, o as IEditorService, h as IFileService, u as IHostService, t as ILanguageStatusService, q as IPaneCompositePartService, l as IPathService, s as IProductService, g as ITextFileService, j as IUriIdentityService, i as IWorkbenchEnvironmentService, k as IWorkingCopyFileService, y as NotificationsFilter, v as Services } from './services-7a462d46.js';
1
+ export { l as IEditorGroupsService, k as IEditorService, e as IFileService, q as IHostService, p as ILanguageStatusService, n as IPaneCompositePartService, i as IPathService, o as IProductService, b as ITextFileService, g as IUriIdentityService, f as IWorkbenchEnvironmentService, h as IWorkingCopyFileService, v as NotificationsFilter, s as Services } from './services-9299c4ca.js';
2
2
  export { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
3
3
  export { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
4
4
  export { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
@@ -20,6 +20,7 @@ export { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/commo
20
20
  export { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
21
21
  export { default as Severity } from 'monaco-editor/esm/vs/base/common/severity.js';
22
22
  import 'monaco-editor/esm/vs/platform/environment/common/environment.js';
23
+ import './tslib.es6-16b40665.js';
23
24
  import 'monaco-editor/esm/vs/base/common/network.js';
24
25
  import 'monaco-editor/esm/vs/base/common/platform.js';
25
26
  import 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
@@ -0,0 +1,21 @@
1
+ function __decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ function __param(paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ }
10
+ function __classPrivateFieldGet(receiver, state, kind, f) {
11
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
12
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
13
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
+ }
15
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
16
+ if (kind === "m") throw new TypeError("Private method is not writable");
17
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
18
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
19
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
20
+ }
21
+ export { __classPrivateFieldSet as _, __classPrivateFieldGet as a, __decorate as b, __param as c };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "1.67.16",
3
+ "version": "1.67.19",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor",
6
6
  "keywords": [],
@@ -35,6 +35,10 @@
35
35
  "./service-override/configuration": {
36
36
  "types": "./dist/configuration.d.ts",
37
37
  "default": "./dist/configuration.js"
38
+ },
39
+ "./monaco": {
40
+ "types": "./dist/monaco.d.ts",
41
+ "default": "./dist/monaco.js"
38
42
  }
39
43
  },
40
44
  "typesVersions": {
@@ -50,6 +54,9 @@
50
54
  ],
51
55
  "service-override/configuration": [
52
56
  "./dist/configuration.d.ts"
57
+ ],
58
+ "monaco": [
59
+ "./dist/monaco.d.ts"
53
60
  ]
54
61
  }
55
62
  },