@codingame/monaco-vscode-api 2.0.1 → 2.0.3-improve-modularity.1

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/README.md CHANGED
@@ -37,38 +37,15 @@ While it works great in `build` mode (because rollup is used), there is some iss
37
37
 
38
38
  There are workarounds for both:
39
39
 
40
- - We can help vite by replacing `import.meta.url` by the original module path (you need the `--experimental-import-meta-resolve` note option):
40
+ - We can help vite by replacing `import.meta.url` by the original module path:
41
41
  ```typescript
42
+ import importMetaUrlPlugin from '@codingame/esbuild-import-meta-url-plugin'
43
+
42
44
  {
43
45
  ...
44
46
  optimizeDeps: {
45
47
  esbuildOptions: {
46
- plugins: [{
47
- name: 'import.meta.url',
48
- setup ({ onLoad }) {
49
- // Help vite that bundles/move files in dev mode without touching `import.meta.url` which breaks asset urls
50
- onLoad({ filter: /.*\.js/, namespace: 'file' }, async args => {
51
- const code = fs.readFileSync(args.path, 'utf8')
52
-
53
- const assetImportMetaUrlRE = /\bnew\s+URL\s*\(\s*('[^']+'|"[^"]+"|`[^`]+`)\s*,\s*import\.meta\.url\s*(?:,\s*)?\)/g
54
- let i = 0
55
- let newCode = ''
56
- for (let match = assetImportMetaUrlRE.exec(code); match != null; match = assetImportMetaUrlRE.exec(code)) {
57
- newCode += code.slice(i, match.index)
58
-
59
- const path = match[1].slice(1, -1)
60
- const resolved = await import.meta.resolve!(path, url.pathToFileURL(args.path))
61
-
62
- newCode += `new URL(${JSON.stringify(url.fileURLToPath(resolved))}, import.meta.url)`
63
-
64
- i = assetImportMetaUrlRE.lastIndex
65
- }
66
- newCode += code.slice(i)
67
-
68
- return { contents: newCode }
69
- })
70
- }
71
- }]
48
+ plugins: [importMetaUrlPlugin]
72
49
  }
73
50
  }
74
51
  }
@@ -274,7 +251,7 @@ import * as monaco from 'monaco-editor'
274
251
 
275
252
  const modelRef = await monaco.editor.createModelReference(...)
276
253
 
277
- const editor = monaco.editor.createModel({ model: modelRef.object.textEditorModel })
254
+ const editor = monaco.editor.create({ model: modelRef.object.textEditorModel })
278
255
 
279
256
  ...
280
257
 
package/api.js CHANGED
@@ -29,7 +29,7 @@ function createProxy(key) {
29
29
  });
30
30
  }
31
31
  const api = {
32
- version: "1.85.0",
32
+ version: "1.85.2",
33
33
  tasks: createProxy('tasks'),
34
34
  notebooks: createProxy('notebooks'),
35
35
  scm: createProxy('scm'),
@@ -512,8 +512,8 @@ registerSingleton(IPathService, BrowserPathService, 1 );
512
512
  registerSingleton(IProductService, class ProductService {
513
513
  constructor() {
514
514
  this._serviceBrand = undefined;
515
- this.version = "1.85.0";
516
- this.commit = "af28b32d7e553898b2a91af498b1fb666fdebe0c";
515
+ this.version = "1.85.2";
516
+ this.commit = "1.85.2";
517
517
  this.quality = 'oss';
518
518
  this.nameShort = 'Code - OSS Dev';
519
519
  this.nameLong = 'Code - OSS Dev';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "2.0.1",
3
+ "version": "2.0.3-improve-modularity.1",
4
4
  "description": "VSCode public API plugged on the monaco editor",
5
5
  "keywords": [],
6
6
  "author": {
@@ -96,12 +96,12 @@
96
96
  "dependencies": {
97
97
  "vscode-marked": "npm:marked@=3.0.2",
98
98
  "vscode-semver": "npm:semver@=5.5.0",
99
- "@codingame/monaco-vscode-extensions-service-override": "2.0.1",
100
- "@codingame/monaco-vscode-files-service-override": "2.0.1",
101
- "@codingame/monaco-vscode-quickaccess-service-override": "2.0.1",
102
- "@codingame/monaco-vscode-environment-service-override": "2.0.1",
103
- "@codingame/monaco-vscode-layout-service-override": "2.0.1",
104
- "@codingame/monaco-vscode-host-service-override": "2.0.1",
105
- "@codingame/monaco-vscode-base-service-override": "2.0.1"
99
+ "@codingame/monaco-vscode-quickaccess-service-override": "2.0.3-improve-modularity.1",
100
+ "@codingame/monaco-vscode-files-service-override": "2.0.3-improve-modularity.1",
101
+ "@codingame/monaco-vscode-extensions-service-override": "2.0.3-improve-modularity.1",
102
+ "@codingame/monaco-vscode-environment-service-override": "2.0.3-improve-modularity.1",
103
+ "@codingame/monaco-vscode-layout-service-override": "2.0.3-improve-modularity.1",
104
+ "@codingame/monaco-vscode-host-service-override": "2.0.3-improve-modularity.1",
105
+ "@codingame/monaco-vscode-base-service-override": "2.0.3-improve-modularity.1"
106
106
  }
107
107
  }
package/services.js CHANGED
@@ -142,9 +142,9 @@ async function initialize(overrides, container = document.body, configuration =
142
142
  initialize$1(container, configuration);
143
143
  const instantiationService = StandaloneServices.initialize({
144
144
  [( IProductService.toString())]: mixin({
145
- version: "1.85.0",
145
+ version: "1.85.2",
146
146
  quality: 'oss',
147
- commit: "af28b32d7e553898b2a91af498b1fb666fdebe0c",
147
+ commit: "1.85.2",
148
148
  nameShort: 'Code - OSS Dev',
149
149
  nameLong: 'Code - OSS Dev',
150
150
  applicationName: 'code-oss',
@@ -57,7 +57,7 @@ class ContextView extends Disposable {
57
57
  this.useFixedPosition = domPosition !== 1 ;
58
58
  const usedShadowDOM = this.useShadowDOM;
59
59
  this.useShadowDOM = domPosition === 3 ;
60
- if (container === this.container && usedShadowDOM !== this.useShadowDOM) {
60
+ if (container === this.container && usedShadowDOM === this.useShadowDOM) {
61
61
  return;
62
62
  }
63
63
  if (this.container) {
@@ -24,10 +24,10 @@ class ElementSizeObserver extends Disposable {
24
24
  }
25
25
  startObserving() {
26
26
  if (!this._resizeObserver && this._referenceDomElement) {
27
- let observeContentRect = null;
27
+ let observedDimenstion = null;
28
28
  const observeNow = () => {
29
- if (observeContentRect) {
30
- this.observe({ width: observeContentRect.width, height: observeContentRect.height });
29
+ if (observedDimenstion) {
30
+ this.observe({ width: observedDimenstion.width, height: observedDimenstion.height });
31
31
  }
32
32
  else {
33
33
  this.observe();
@@ -51,7 +51,12 @@ class ElementSizeObserver extends Disposable {
51
51
  }
52
52
  };
53
53
  this._resizeObserver = ( new ResizeObserver((entries) => {
54
- observeContentRect = (entries && entries[0] && entries[0].contentRect ? entries[0].contentRect : null);
54
+ if (entries && entries[0] && entries[0].contentRect) {
55
+ observedDimenstion = { width: entries[0].contentRect.width, height: entries[0].contentRect.height };
56
+ }
57
+ else {
58
+ observedDimenstion = null;
59
+ }
55
60
  shouldObserve = true;
56
61
  update();
57
62
  }));
@@ -0,0 +1,4 @@
1
+ import { Registry } from '../../../../platform/registry/common/platform.js';
2
+ import { EditorAutoSave } from './editorAutoSave.js';
3
+ import { Extensions } from '../../../common/contributions.js';
4
+ ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(EditorAutoSave, 2 );
@@ -1,44 +1,3 @@
1
- import { registerThemingParticipant } from '../../platform/theme/common/themeService.js';
2
- import { TITLE_BAR_ACTIVE_BACKGROUND, WORKBENCH_BACKGROUND } from '../common/theme.js';
3
- import { isWeb, isIOS, isWindows, isMacintosh } from '../../base/common/platform.js';
4
- import { createMetaElement } from '../../base/browser/dom.js';
5
- import { isSafari, isStandalone } from '../../base/browser/browser.js';
6
- import { selectionBackground } from '../../platform/theme/common/colorRegistry.js';
7
- import { mainWindow } from '../../base/browser/window.js';
8
- registerThemingParticipant((theme, collector) => {
9
- const workbenchBackground = WORKBENCH_BACKGROUND(theme);
10
- collector.addRule(`.monaco-workbench { background-color: ${workbenchBackground}; }`);
11
- const windowSelectionBackground = theme.getColor(selectionBackground);
12
- if (windowSelectionBackground) {
13
- collector.addRule(`.monaco-workbench ::selection { background-color: ${windowSelectionBackground}; }`);
14
- }
15
- if (isWeb) {
16
- const titleBackground = theme.getColor(TITLE_BAR_ACTIVE_BACKGROUND);
17
- if (titleBackground) {
18
- const metaElementId = 'monaco-workbench-meta-theme-color';
19
- let metaElement = mainWindow.document.getElementById(metaElementId);
20
- if (!metaElement) {
21
- metaElement = createMetaElement();
22
- metaElement.name = 'theme-color';
23
- metaElement.id = metaElementId;
24
- }
25
- metaElement.content = ( titleBackground.toString());
26
- }
27
- }
28
- if (isSafari) {
29
- collector.addRule(`
30
- body.web {
31
- touch-action: none;
32
- }
33
- .monaco-workbench .monaco-editor .view-lines {
34
- user-select: text;
35
- -webkit-user-select: text;
36
- }
37
- `);
38
- }
39
- if (isIOS && isStandalone()) {
40
- collector.addRule(`body { background-color: ${workbenchBackground}; }`);
41
- }
42
- });
1
+ import { isWindows, isMacintosh } from '../../base/common/platform.js';
43
2
  const DEFAULT_FONT_FAMILY = isWindows ? '"Segoe WPC", "Segoe UI", sans-serif' : isMacintosh ? '-apple-system, BlinkMacSystemFont, sans-serif' : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
44
3
  export { DEFAULT_FONT_FAMILY };
@@ -1205,6 +1205,10 @@ const pasteFileHandler = async (accessor, fileList) => {
1205
1205
  }
1206
1206
  const element = context.length ? context[0] : explorerService.roots[0];
1207
1207
  const incrementalNaming = configurationService.getValue().explorer.incrementalNaming;
1208
+ const editableItem = explorerService.getEditable();
1209
+ if (editableItem) {
1210
+ return;
1211
+ }
1208
1212
  try {
1209
1213
  const sourceTargetPairs = coalesce(await Promise.all(( toPaste.map(async (fileToPaste) => {
1210
1214
  if (( element.resource.toString()) !== ( fileToPaste.toString()) && isEqualOrParent(element.resource, fileToPaste)) {