@codingame/monaco-vscode-api 22.1.3 → 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
@@ -1,2 +1,4 @@
1
- export declare function registerCss(module: unknown): void;
1
+ export declare function registerCss(module: {
2
+ default?: string | CSSStyleSheet;
3
+ } | undefined): void;
2
4
  export declare function injectCss(target: HTMLElement): void;
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.default;
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",
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.3",
19
- "@codingame/monaco-vscode-environment-service-override": "22.1.3",
20
- "@codingame/monaco-vscode-extensions-service-override": "22.1.3",
21
- "@codingame/monaco-vscode-files-service-override": "22.1.3",
22
- "@codingame/monaco-vscode-host-service-override": "22.1.3",
23
- "@codingame/monaco-vscode-layout-service-override": "22.1.3",
24
- "@codingame/monaco-vscode-quickaccess-service-override": "22.1.3",
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-ead3bf38-2ced-47ac-aa64-b5d108d09558") {
407
- throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.105.0-ead3bf38-2ced-47ac-aa64-b5d108d09558"}, ${window.monacoVscodeApiBuildId} is already loaded`);
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-ead3bf38-2ced-47ac-aa64-b5d108d09558";
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
- dompurify.addHook('afterSanitizeAttributes', (node) => {
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
- dompurify.addHook('uponSanitizeElement', replaceWithPlainTextHook);
193
+ mainWindowDompurify.addHook('uponSanitizeElement', replaceWithPlainTextHook);
192
194
  }
193
195
  if (allowedAttrPredicates.size) {
194
- dompurify.addHook('uponSanitizeAttribute', (node, e) => {
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 dompurify.sanitize(untrusted, {
214
+ return mainWindowDompurify.sanitize(untrusted, {
213
215
  ...resolvedConfig,
214
216
  RETURN_DOM_FRAGMENT: true
215
217
  });
216
218
  }
217
219
  else {
218
- return dompurify.sanitize(untrusted, {
220
+ return mainWindowDompurify.sanitize(untrusted, {
219
221
  ...resolvedConfig,
220
222
  RETURN_TRUSTED_TYPE: true
221
223
  });
222
224
  }
223
225
  }
224
226
  finally {
225
- dompurify.removeAllHooks();
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'];
@@ -6,7 +6,7 @@ var product = {
6
6
  quality: 'stable',
7
7
  version: '1.105.0',
8
8
  commit: '03c265b1adee71ac88f833e065f7bb956b60550a',
9
- date: '2025-10-24T08:45:08.589Z',
9
+ date: '2025-11-04T10:01:16.489Z',
10
10
  ...(globalThis._VSCODE_PRODUCT_JSON ?? {})
11
11
  };
12
12