@codingame/monaco-vscode-api 36.2.5 → 36.2.7

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.js CHANGED
@@ -5,30 +5,35 @@ const sheets = [];
5
5
  function registerCss(module) {
6
6
  const exportedValue = module?.default;
7
7
  let sheet = undefined;
8
+ let sheetPromise = undefined;
8
9
  if (typeof exportedValue === 'string') {
9
10
  sheet = new mainWindow.CSSStyleSheet();
10
- sheet.replaceSync(exportedValue);
11
+ sheetPromise = sheet.replace(exportedValue);
11
12
  }
12
13
  else if (exportedValue instanceof CSSStyleSheet) {
13
14
  sheet = new mainWindow.CSSStyleSheet();
14
- sheet.replaceSync(Array.from(exportedValue.cssRules)
15
+ sheetPromise = sheet.replace(Array.from(exportedValue.cssRules)
15
16
  .map((r) => r.cssText)
16
17
  .join('\n'));
17
18
  }
18
- if (sheet != null) {
19
- const fontFaces = Array.from(sheet.cssRules)
20
- .filter((rule) => rule instanceof mainWindow.CSSFontFaceRule)
21
- .map((r) => r.cssText);
22
- if (fontFaces.length > 0) {
23
- const fontFaceStyleSheet = new mainWindow.CSSStyleSheet();
24
- for (const fontFace of fontFaces) {
25
- fontFaceStyleSheet.insertRule(fontFace);
19
+ if (sheetPromise != null) {
20
+ sheetPromise.then((sheet) => {
21
+ const fontFaces = Array.from(sheet.cssRules)
22
+ .filter((rule) => rule instanceof mainWindow.CSSFontFaceRule)
23
+ .map((r) => r.cssText);
24
+ if (fontFaces.length > 0) {
25
+ const fontFaceStyleSheet = new mainWindow.CSSStyleSheet();
26
+ for (const fontFace of fontFaces) {
27
+ fontFaceStyleSheet.insertRule(fontFace);
28
+ }
29
+ mainWindow.document.adoptedStyleSheets = [
30
+ ...mainWindow.document.adoptedStyleSheets,
31
+ fontFaceStyleSheet
32
+ ];
26
33
  }
27
- mainWindow.document.adoptedStyleSheets = [
28
- ...mainWindow.document.adoptedStyleSheets,
29
- fontFaceStyleSheet
30
- ];
31
- }
34
+ });
35
+ }
36
+ if (sheet != null) {
32
37
  sheets.push(sheet);
33
38
  }
34
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "36.2.5",
3
+ "version": "36.2.7",
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": "36.2.5",
19
- "@codingame/monaco-vscode-environment-service-override": "36.2.5",
20
- "@codingame/monaco-vscode-extensions-service-override": "36.2.5",
21
- "@codingame/monaco-vscode-files-service-override": "36.2.5",
22
- "@codingame/monaco-vscode-host-service-override": "36.2.5",
23
- "@codingame/monaco-vscode-layout-service-override": "36.2.5",
24
- "@codingame/monaco-vscode-quickaccess-service-override": "36.2.5",
18
+ "@codingame/monaco-vscode-base-service-override": "36.2.7",
19
+ "@codingame/monaco-vscode-environment-service-override": "36.2.7",
20
+ "@codingame/monaco-vscode-extensions-service-override": "36.2.7",
21
+ "@codingame/monaco-vscode-files-service-override": "36.2.7",
22
+ "@codingame/monaco-vscode-host-service-override": "36.2.7",
23
+ "@codingame/monaco-vscode-layout-service-override": "36.2.7",
24
+ "@codingame/monaco-vscode-quickaccess-service-override": "36.2.7",
25
25
  "@vscode/diff": "0.0.2-7",
26
26
  "@vscode/iconv-lite-umd": "0.7.1",
27
27
  "dompurify": "3.4.14",
@@ -193,7 +193,7 @@ declare class StandaloneEditorGroup extends Disposable implements IEditorGroup,
193
193
  get activeEditorPane(): StandaloneEditorPane | undefined;
194
194
  get activeEditor(): TextResourceEditorInput | null;
195
195
  previewEditor: null;
196
- get count(): 0 | 1;
196
+ get count(): 1 | 0;
197
197
  get isEmpty(): boolean;
198
198
  isLocked: boolean;
199
199
  stickyCount: number;
package/services.js CHANGED
@@ -458,10 +458,10 @@ export { IAgentHostCustomizationService } from './vscode/src/vs/workbench/contri
458
458
  export { IAgentHostActiveClientService } from './vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.js';
459
459
  export { IAgentEditorCommentsBridge } from './vscode/src/vs/workbench/services/agentEditorComments/common/agentEditorComments.service.js';
460
460
 
461
- if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.128.1-c53fa988-bdaf-49b5-8064-b6d0568dee0f") {
462
- throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.128.1-c53fa988-bdaf-49b5-8064-b6d0568dee0f"}, ${window.monacoVscodeApiBuildId} is already loaded`);
461
+ if (window.monacoVscodeApiBuildId != null && window.monacoVscodeApiBuildId !== "1.128.1-427d70a2-3dc2-4ddb-9347-ea6b73dad61a") {
462
+ throw new Error(`Another version of monaco-vscode-api has already been loaded. Trying to load ${"1.128.1-427d70a2-3dc2-4ddb-9347-ea6b73dad61a"}, ${window.monacoVscodeApiBuildId} is already loaded`);
463
463
  }
464
- window.monacoVscodeApiBuildId = "1.128.1-c53fa988-bdaf-49b5-8064-b6d0568dee0f";
464
+ window.monacoVscodeApiBuildId = "1.128.1-427d70a2-3dc2-4ddb-9347-ea6b73dad61a";
465
465
  function registerCommands(options) {
466
466
  function asMenuId(menu) {
467
467
  switch (menu) {
@@ -1,3 +1,4 @@
1
+ import { URI } from "../common/uri.js";
1
2
  export declare class IframeUtils {
2
3
  /**
3
4
  * Returns a chain of embedded windows with the same origin (which can be accessed programmatically).
@@ -16,3 +17,7 @@ export declare class IframeUtils {
16
17
  * Returns a sha-256 composed of `parentOrigin` and `salt` converted to base 32
17
18
  */
18
19
  export declare function parentOriginHash(parentOrigin: string, salt: string): Promise<string>;
20
+ /**
21
+ * Replaces a URI authority placeholder without exceeding the DNS label length limit.
22
+ */
23
+ export declare function replaceUriAuthorityPlaceholder(uri: URI, placeholder: string, replacement: string): URI;
@@ -91,5 +91,21 @@ function sha256AsBase32(bytes) {
91
91
  const hexArray = ( array.map(b => ( b.toString(16)).padStart(2, "0"))).join("");
92
92
  return ( BigInt(`0x${hexArray}`).toString(32)).padStart(52, "0");
93
93
  }
94
+ function replaceUriAuthorityPlaceholder(uri, placeholder, replacement) {
95
+ const placeholderIndex = uri.authority.indexOf(placeholder);
96
+ if (placeholderIndex === -1) {
97
+ return uri;
98
+ }
99
+ const labelStart = uri.authority.lastIndexOf(".", placeholderIndex) + 1;
100
+ const labelEnd = uri.authority.indexOf(".", placeholderIndex + placeholder.length);
101
+ const labelLength = (labelEnd === -1 ? uri.authority.length : labelEnd) - labelStart;
102
+ const replacementLength = 63 - labelLength + placeholder.length;
103
+ if (replacementLength < 0) {
104
+ throw ( new Error("URI authority label exceeds the DNS length limit"));
105
+ }
106
+ return uri.with({
107
+ authority: uri.authority.replace(placeholder, replacement.slice(0, replacementLength))
108
+ });
109
+ }
94
110
 
95
- export { IframeUtils, parentOriginHash };
111
+ export { IframeUtils, parentOriginHash, replaceUriAuthorityPlaceholder };
@@ -6,7 +6,7 @@ var product = {
6
6
  quality: 'stable',
7
7
  version: '1.128.1',
8
8
  commit: '5264f2156cbcd7aea5fd004d29eaa10209155d66',
9
- date: '2026-08-28T15:58:54.263Z',
9
+ date: '2026-09-01T15:06:12.367Z',
10
10
  ...(globalThis._VSCODE_PRODUCT_JSON ?? {})
11
11
  };
12
12