monaco-editor-core 0.56.0-dev-20260123 → 0.56.0-dev-20260124

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.
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20260123(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
3
+ * Version: 0.56.0-dev-20260124(fe9dd23f49a64c1b2811d9eeec98f38876f93511)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -82,14 +82,28 @@ export const { registerWindow, getWindow, getDocument, getWindows, getWindowsCou
82
82
  }
83
83
  };
84
84
  })();
85
- //#endregion
86
- //#region External Focus Tracking
87
85
  /**
88
86
  * A registry for functions that check if a component outside the normal DOM tree has focus.
89
87
  * This is used to extend the concept of "window has focus" to include things like
90
88
  * Electron WebContentsViews (browser views) that exist outside the workbench DOM.
91
89
  */
92
90
  const externalFocusCheckers = new Set();
91
+ /**
92
+ * Get the window associated with a focused external component.
93
+ * This is used to determine which window should receive UI like dialogs
94
+ * when an external component (like a browser view) has focus.
95
+ *
96
+ * @returns The window of the focused external component, or undefined if none
97
+ */
98
+ export function getExternalFocusWindow() {
99
+ for (const checker of externalFocusCheckers) {
100
+ const info = checker();
101
+ if (info.hasFocus && info.window) {
102
+ return info.window;
103
+ }
104
+ }
105
+ return undefined;
106
+ }
93
107
  //#endregion
94
108
  export function clearNode(node) {
95
109
  while (node.firstChild) {
@@ -578,15 +592,24 @@ export function isAncestorOfActiveElement(ancestor) {
578
592
  }
579
593
  /**
580
594
  * Returns the active document across main and child windows.
581
- * Prefers the window with focus, otherwise falls back to
582
- * the main windows document.
595
+ * Prefers the window with focus (including external components like browser views),
596
+ * otherwise falls back to the main windows document.
583
597
  */
584
598
  export function getActiveDocument() {
585
599
  if (getWindowsCount() <= 1) {
586
600
  return mainWindow.document;
587
601
  }
588
602
  const documents = Array.from(getWindows()).map(({ window }) => window.document);
589
- return documents.find(doc => doc.hasFocus()) ?? mainWindow.document;
603
+ const focusedDoc = documents.find(doc => doc.hasFocus());
604
+ if (focusedDoc) {
605
+ return focusedDoc;
606
+ }
607
+ // Check if an external component (like browser view) has focus
608
+ const externalWindow = getExternalFocusWindow();
609
+ if (externalWindow) {
610
+ return externalWindow.document;
611
+ }
612
+ return mainWindow.document;
590
613
  }
591
614
  /**
592
615
  * Returns the active window across main and child windows.