@codingame/monaco-vscode-api 2.0.0 → 2.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.
- package/README.md +5 -28
- package/api.js +1 -1
- package/missing-services.js +2 -2
- package/package.json +8 -8
- package/services.js +2 -2
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/vscode/src/vs/editor/browser/config/elementSizeObserver.js +9 -4
- package/vscode/src/vs/workbench/browser/style.js +1 -42
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +4 -0
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +3 -1
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +4 -4
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
|
|
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.
|
|
254
|
+
const editor = monaco.editor.create({ model: modelRef.object.textEditorModel })
|
|
278
255
|
|
|
279
256
|
...
|
|
280
257
|
|
package/api.js
CHANGED
package/missing-services.js
CHANGED
|
@@ -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.
|
|
516
|
-
this.commit = "
|
|
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.
|
|
3
|
+
"version": "2.0.2",
|
|
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-
|
|
100
|
-
"@codingame/monaco-vscode-files-service-override": "2.0.
|
|
101
|
-
"@codingame/monaco-vscode-
|
|
102
|
-
"@codingame/monaco-vscode-environment-service-override": "2.0.
|
|
103
|
-
"@codingame/monaco-vscode-layout-service-override": "2.0.
|
|
104
|
-
"@codingame/monaco-vscode-host-service-override": "2.0.
|
|
105
|
-
"@codingame/monaco-vscode-base-service-override": "2.0.
|
|
99
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.0.2",
|
|
100
|
+
"@codingame/monaco-vscode-files-service-override": "2.0.2",
|
|
101
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.0.2",
|
|
102
|
+
"@codingame/monaco-vscode-environment-service-override": "2.0.2",
|
|
103
|
+
"@codingame/monaco-vscode-layout-service-override": "2.0.2",
|
|
104
|
+
"@codingame/monaco-vscode-host-service-override": "2.0.2",
|
|
105
|
+
"@codingame/monaco-vscode-base-service-override": "2.0.2"
|
|
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.
|
|
145
|
+
version: "1.85.2",
|
|
146
146
|
quality: 'oss',
|
|
147
|
-
commit: "
|
|
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
|
|
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
|
|
27
|
+
let observedDimenstion = null;
|
|
28
28
|
const observeNow = () => {
|
|
29
|
-
if (
|
|
30
|
-
this.observe({ width:
|
|
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
|
-
|
|
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
|
}));
|
|
@@ -1,44 +1,3 @@
|
|
|
1
|
-
import {
|
|
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)) {
|
|
@@ -219,7 +219,9 @@ let ExplorerView = class ExplorerView extends ViewPane {
|
|
|
219
219
|
if (!this.hasFocus() || this.readonlyContext.get()) {
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
|
|
222
|
+
if (event.clipboardData?.files?.length) {
|
|
223
|
+
await this.commandService.executeCommand('filesExplorer.paste', event.clipboardData?.files);
|
|
224
|
+
}
|
|
223
225
|
}));
|
|
224
226
|
}
|
|
225
227
|
focus() {
|
|
@@ -391,10 +391,10 @@ let QueryBuilder = class QueryBuilder {
|
|
|
391
391
|
folderName: includeFolderName ? folderName : undefined,
|
|
392
392
|
excludePattern: ( Object.keys(excludePattern)).length > 0 ? excludePattern : undefined,
|
|
393
393
|
fileEncoding: folderConfig.files && folderConfig.files.encoding,
|
|
394
|
-
disregardIgnoreFiles: typeof options.disregardIgnoreFiles === 'boolean' ? options.disregardIgnoreFiles : !folderConfig.search
|
|
395
|
-
disregardGlobalIgnoreFiles: typeof options.disregardGlobalIgnoreFiles === 'boolean' ? options.disregardGlobalIgnoreFiles : !folderConfig.search
|
|
396
|
-
disregardParentIgnoreFiles: typeof options.disregardParentIgnoreFiles === 'boolean' ? options.disregardParentIgnoreFiles : !folderConfig.search
|
|
397
|
-
ignoreSymlinks: typeof options.ignoreSymlinks === 'boolean' ? options.ignoreSymlinks : !folderConfig.search
|
|
394
|
+
disregardIgnoreFiles: typeof options.disregardIgnoreFiles === 'boolean' ? options.disregardIgnoreFiles : !folderConfig.search?.useIgnoreFiles,
|
|
395
|
+
disregardGlobalIgnoreFiles: typeof options.disregardGlobalIgnoreFiles === 'boolean' ? options.disregardGlobalIgnoreFiles : !folderConfig.search?.useGlobalIgnoreFiles,
|
|
396
|
+
disregardParentIgnoreFiles: typeof options.disregardParentIgnoreFiles === 'boolean' ? options.disregardParentIgnoreFiles : !folderConfig.search?.useParentIgnoreFiles,
|
|
397
|
+
ignoreSymlinks: typeof options.ignoreSymlinks === 'boolean' ? options.ignoreSymlinks : !folderConfig.search?.followSymlinks,
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
400
|
};
|