@lvce-editor/main-process 6.2.0 → 6.4.0

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.
@@ -3844,6 +3844,23 @@ const loadUrl = async (browserWindow, url) => {
3844
3844
  }
3845
3845
  mark(DidLoadUrl);
3846
3846
  };
3847
+ const addDevDiagnostics = window => {
3848
+ if (!process.env.DEV) {
3849
+ return;
3850
+ }
3851
+ window.webContents.on('console-message', (_event, level, message, line, sourceId) => {
3852
+ info(`[app window console] level=${level} source=${sourceId}:${line} message=${message}`);
3853
+ });
3854
+ window.webContents.on('did-fail-load', (_event, errorCode, errorDescription, validatedUrl, isMainFrame) => {
3855
+ error(`[app window did-fail-load] code=${errorCode} mainFrame=${isMainFrame} url=${validatedUrl} error=${errorDescription}`);
3856
+ });
3857
+ window.webContents.on('render-process-gone', (_event, details) => {
3858
+ error(`[app window render-process-gone] reason=${details.reason} exitCode=${details.exitCode}`);
3859
+ });
3860
+ window.webContents.on('did-finish-load', () => {
3861
+ info('[app window did-finish-load]');
3862
+ });
3863
+ };
3847
3864
 
3848
3865
  // TODO avoid mixing BrowserWindow, childprocess and various lifecycle methods in one file -> separate concerns
3849
3866
  const createAppWindow = async (windowOptions, parsedArgs, workingDirectory, titleBarItems, url) => {
@@ -3857,6 +3874,7 @@ const createAppWindow = async (windowOptions, parsedArgs, workingDirectory, titl
3857
3874
  }
3858
3875
  });
3859
3876
  mark(DidCreateCodeWindow);
3877
+ addDevDiagnostics(window);
3860
3878
  const handleReadyToShow = () => {
3861
3879
  // due to electron bug, zoom level needs to be set here,
3862
3880
  // cannot be set when creating the browser window
@@ -4227,6 +4245,9 @@ const getWindowById = windowId => {
4227
4245
  };
4228
4246
 
4229
4247
  const devtoolsBeforeInputListeners = new WeakMap();
4248
+ const devtoolsOptions = {
4249
+ mode: 'bottom'
4250
+ };
4230
4251
  const isToggleDevtoolsInput = input => {
4231
4252
  if (input.type !== 'keyDown') {
4232
4253
  return false;
@@ -4291,7 +4312,7 @@ const toggleDevtools = browserWindow => {
4291
4312
  attachDevtoolsKeyListener(browserWindow);
4292
4313
  });
4293
4314
  }
4294
- browserWindow.webContents.openDevTools();
4315
+ browserWindow.webContents.openDevTools(devtoolsOptions);
4295
4316
  };
4296
4317
  const executeWindowFunction = (browserWindowId, key) => {
4297
4318
  const browserWindow = getBrowserWindow(browserWindowId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "6.2.0",
3
+ "version": "6.4.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"
@@ -14,7 +14,7 @@
14
14
  "type": "module",
15
15
  "main": "dist/mainProcessMain.js",
16
16
  "dependencies": {
17
- "electron": "41.7.0"
17
+ "electron": "41.2.0"
18
18
  },
19
19
  "engines": {
20
20
  "node": ">=22"