@lvce-editor/main-process 6.22.1 → 6.24.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.
- package/dist/mainProcessMain.js +25 -9
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -2267,7 +2267,7 @@ const IpcChildWithNodeWorker$1 = {
|
|
|
2267
2267
|
wrap: wrap$b
|
|
2268
2268
|
};
|
|
2269
2269
|
const preloadChannelType = 'port';
|
|
2270
|
-
const listen$2 = ({
|
|
2270
|
+
const listen$2$1 = ({
|
|
2271
2271
|
webContents
|
|
2272
2272
|
}) => {
|
|
2273
2273
|
return webContents;
|
|
@@ -2309,7 +2309,7 @@ const wrap$a = webContents => {
|
|
|
2309
2309
|
};
|
|
2310
2310
|
const IpcChildWithRendererProcess2$1 = {
|
|
2311
2311
|
__proto__: null,
|
|
2312
|
-
listen: listen$2,
|
|
2312
|
+
listen: listen$2$1,
|
|
2313
2313
|
wrap: wrap$a
|
|
2314
2314
|
};
|
|
2315
2315
|
const addListener$1 = (emitter, type, callback) => {
|
|
@@ -3333,7 +3333,7 @@ const handleIpc$1 = ipc => {
|
|
|
3333
3333
|
}
|
|
3334
3334
|
};
|
|
3335
3335
|
|
|
3336
|
-
const listen$
|
|
3336
|
+
const listen$2 = async (module, options) => {
|
|
3337
3337
|
const rawIpc = await module.listen(options);
|
|
3338
3338
|
if (module.signal) {
|
|
3339
3339
|
module.signal(rawIpc);
|
|
@@ -3349,7 +3349,7 @@ const create$5 = async ({
|
|
|
3349
3349
|
}) => {
|
|
3350
3350
|
// TODO create a commandMap per rpc instance
|
|
3351
3351
|
register(commandMap);
|
|
3352
|
-
const ipc = await listen$
|
|
3352
|
+
const ipc = await listen$2(IpcChildWithElectronMessagePort$1, {
|
|
3353
3353
|
messagePort
|
|
3354
3354
|
});
|
|
3355
3355
|
if (requiresSocket) {
|
|
@@ -4499,6 +4499,21 @@ const registerWebviewProtocol = async port => {
|
|
|
4499
4499
|
handle(session.protocol, WebView, handleRequest);
|
|
4500
4500
|
};
|
|
4501
4501
|
|
|
4502
|
+
const listen$1 = (browserWindow, rpc) => {
|
|
4503
|
+
const handleEnterFullScreen = () => {
|
|
4504
|
+
rpc.send('Window.handleFullScreenChange', true);
|
|
4505
|
+
};
|
|
4506
|
+
const handleLeaveFullScreen = () => {
|
|
4507
|
+
rpc.send('Window.handleFullScreenChange', false);
|
|
4508
|
+
};
|
|
4509
|
+
browserWindow.on('enter-full-screen', handleEnterFullScreen);
|
|
4510
|
+
browserWindow.on('leave-full-screen', handleLeaveFullScreen);
|
|
4511
|
+
return () => {
|
|
4512
|
+
browserWindow.off('enter-full-screen', handleEnterFullScreen);
|
|
4513
|
+
browserWindow.off('leave-full-screen', handleLeaveFullScreen);
|
|
4514
|
+
};
|
|
4515
|
+
};
|
|
4516
|
+
|
|
4502
4517
|
class WindowLoadError extends VError {
|
|
4503
4518
|
constructor(error, url) {
|
|
4504
4519
|
super(error, `Failed to load url ${url}`);
|
|
@@ -4595,19 +4610,20 @@ const createAppWindow = async (windowOptions, parsedArgs, workingDirectory, titl
|
|
|
4595
4610
|
// window.setMenu(menu)
|
|
4596
4611
|
window.setMenuBarVisibility(true);
|
|
4597
4612
|
window.setAutoHideMenuBar(false);
|
|
4598
|
-
|
|
4613
|
+
const rpc = await create$3({
|
|
4614
|
+
commandMap: commandMapRef,
|
|
4615
|
+
webContents: window.webContents
|
|
4616
|
+
});
|
|
4617
|
+
const disposeFullScreenListener = listen$1(window, rpc);
|
|
4599
4618
|
const handleWindowClose = () => {
|
|
4600
4619
|
try {
|
|
4620
|
+
disposeFullScreenListener();
|
|
4601
4621
|
window.off('close', handleWindowClose);
|
|
4602
4622
|
} catch (error) {
|
|
4603
4623
|
handleError(new VError(error, `Failed to run window close listener`));
|
|
4604
4624
|
}
|
|
4605
4625
|
};
|
|
4606
4626
|
window.on('close', handleWindowClose);
|
|
4607
|
-
await create$3({
|
|
4608
|
-
commandMap: commandMapRef,
|
|
4609
|
-
webContents: window.webContents
|
|
4610
|
-
});
|
|
4611
4627
|
await loadUrl(window, url);
|
|
4612
4628
|
};
|
|
4613
4629
|
|