@codingame/monaco-vscode-api 22.1.2 → 22.1.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.
package/css.d.ts
CHANGED
package/css.js
CHANGED
|
@@ -3,7 +3,7 @@ import { mainWindow } from './vscode/src/vs/base/browser/window.js';
|
|
|
3
3
|
|
|
4
4
|
const sheets = [];
|
|
5
5
|
function registerCss(module) {
|
|
6
|
-
const exportedValue = module
|
|
6
|
+
const exportedValue = module?.default;
|
|
7
7
|
let sheet = undefined;
|
|
8
8
|
if (typeof exportedValue === 'string') {
|
|
9
9
|
sheet = new mainWindow.CSSStyleSheet();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-base-service-override": "22.1.
|
|
19
|
-
"@codingame/monaco-vscode-environment-service-override": "22.1.
|
|
20
|
-
"@codingame/monaco-vscode-extensions-service-override": "22.1.
|
|
21
|
-
"@codingame/monaco-vscode-files-service-override": "22.1.
|
|
22
|
-
"@codingame/monaco-vscode-host-service-override": "22.1.
|
|
23
|
-
"@codingame/monaco-vscode-layout-service-override": "22.1.
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "22.1.
|
|
18
|
+
"@codingame/monaco-vscode-base-service-override": "22.1.4",
|
|
19
|
+
"@codingame/monaco-vscode-environment-service-override": "22.1.4",
|
|
20
|
+
"@codingame/monaco-vscode-extensions-service-override": "22.1.4",
|
|
21
|
+
"@codingame/monaco-vscode-files-service-override": "22.1.4",
|
|
22
|
+
"@codingame/monaco-vscode-host-service-override": "22.1.4",
|
|
23
|
+
"@codingame/monaco-vscode-layout-service-override": "22.1.4",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "22.1.4",
|
|
25
25
|
"@vscode/iconv-lite-umd": "0.7.0",
|
|
26
26
|
"dompurify": "3.2.7",
|
|
27
27
|
"jschardet": "3.1.4",
|
package/services.js
CHANGED
|
@@ -403,10 +403,10 @@ export { IInlineCompletionsUnificationService } from './vscode/src/vs/workbench/
|
|
|
403
403
|
export { IMcpGalleryManifestService } from './vscode/src/vs/platform/mcp/common/mcpGalleryManifest.service.js';
|
|
404
404
|
export { IDataChannelService } from './vscode/src/vs/platform/dataChannel/common/dataChannel.service.js';
|
|
405
405
|
|
|
406
|
-
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.105.0-
|
|
407
|
-
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.105.0-
|
|
406
|
+
if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.105.0-cffdc119-fd7a-4932-9570-cab2f05f895b") {
|
|
407
|
+
throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.105.0-cffdc119-fd7a-4932-9570-cab2f05f895b"}, ${window.monacoVscodeApiBuildId} is already loaded`);
|
|
408
408
|
}
|
|
409
|
-
window.monacoVscodeApiBuildId = "1.105.0-
|
|
409
|
+
window.monacoVscodeApiBuildId = "1.105.0-cffdc119-fd7a-4932-9570-cab2f05f895b";
|
|
410
410
|
function registerCommands(options) {
|
|
411
411
|
function asMenuId(menu) {
|
|
412
412
|
switch (menu) {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { Schemas } from '../common/network.js';
|
|
3
3
|
import { reset } from './dom.js';
|
|
4
4
|
import dompurify from 'dompurify';
|
|
5
|
+
import { mainWindow } from './window.js';
|
|
5
6
|
|
|
7
|
+
const mainWindowDompurify = dompurify(mainWindow);
|
|
6
8
|
const basicMarkupHtmlTags = ( Object.freeze([
|
|
7
9
|
'a',
|
|
8
10
|
'abbr',
|
|
@@ -114,7 +116,7 @@ function validateLink(value, allowedProtocols) {
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
function hookDomPurifyHrefAndSrcSanitizer(allowedLinkProtocols, allowedMediaProtocols) {
|
|
117
|
-
|
|
119
|
+
mainWindowDompurify.addHook('afterSanitizeAttributes', (node) => {
|
|
118
120
|
for (const attr of ['href', 'src']) {
|
|
119
121
|
if (node.hasAttribute(attr)) {
|
|
120
122
|
const attrValue = node.getAttribute(attr);
|
|
@@ -188,10 +190,10 @@ function doSanitizeHtml(untrusted, config, outputType) {
|
|
|
188
190
|
allowRelativePaths: config?.allowRelativeMediaPaths ?? false
|
|
189
191
|
});
|
|
190
192
|
if (config?.replaceWithPlaintext) {
|
|
191
|
-
|
|
193
|
+
mainWindowDompurify.addHook('uponSanitizeElement', replaceWithPlainTextHook);
|
|
192
194
|
}
|
|
193
195
|
if (allowedAttrPredicates.size) {
|
|
194
|
-
|
|
196
|
+
mainWindowDompurify.addHook('uponSanitizeAttribute', (node, e) => {
|
|
195
197
|
const predicate = allowedAttrPredicates.get(e.attrName);
|
|
196
198
|
if (predicate) {
|
|
197
199
|
const result = predicate.shouldKeep(node, e);
|
|
@@ -209,20 +211,20 @@ function doSanitizeHtml(untrusted, config, outputType) {
|
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
if (outputType === 'dom') {
|
|
212
|
-
return
|
|
214
|
+
return mainWindowDompurify.sanitize(untrusted, {
|
|
213
215
|
...resolvedConfig,
|
|
214
216
|
RETURN_DOM_FRAGMENT: true
|
|
215
217
|
});
|
|
216
218
|
}
|
|
217
219
|
else {
|
|
218
|
-
return
|
|
220
|
+
return mainWindowDompurify.sanitize(untrusted, {
|
|
219
221
|
...resolvedConfig,
|
|
220
222
|
RETURN_TRUSTED_TYPE: true
|
|
221
223
|
});
|
|
222
224
|
}
|
|
223
225
|
}
|
|
224
226
|
finally {
|
|
225
|
-
|
|
227
|
+
mainWindowDompurify.removeAllHooks();
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
230
|
const selfClosingTags = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
|
@@ -891,7 +891,7 @@ class Extension {
|
|
|
891
891
|
this.#originExtensionId = originExtensionId;
|
|
892
892
|
this.#identifier = description.identifier;
|
|
893
893
|
this.id = description.identifier.value;
|
|
894
|
-
this.isBuiltin = description.isBuiltin;
|
|
894
|
+
this.isBuiltin = description.isBuiltin || description.isUserBuiltin;
|
|
895
895
|
this.extensionUri = description.extensionLocation;
|
|
896
896
|
this.extensionPath = normalize(originalFSPath(description.extensionLocation));
|
|
897
897
|
this.packageJSON = description;
|