@lvce-editor/main-area-worker 9.45.1 → 9.46.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/mainAreaWorkerMain.js +14 -3
- package/package.json +1 -1
|
@@ -5427,9 +5427,19 @@ const set = rpc => {
|
|
|
5427
5427
|
state.connected = true;
|
|
5428
5428
|
};
|
|
5429
5429
|
|
|
5430
|
-
const handleMessagePort = async port => {
|
|
5430
|
+
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
5431
|
+
const executeViewletCommand = async (uid, command, ...args) => {
|
|
5432
|
+
const fn = viewletCommandMap[`MainArea.${command}`];
|
|
5433
|
+
if (typeof fn !== 'function') {
|
|
5434
|
+
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
5435
|
+
}
|
|
5436
|
+
await fn(uid, ...args);
|
|
5437
|
+
await invoke$1('Viewlet.requestRender', uid);
|
|
5438
|
+
};
|
|
5431
5439
|
const rpc = await create$8({
|
|
5432
|
-
commandMap: {
|
|
5440
|
+
commandMap: {
|
|
5441
|
+
'Viewlet.executeViewletCommand': executeViewletCommand
|
|
5442
|
+
},
|
|
5433
5443
|
messagePort: port
|
|
5434
5444
|
});
|
|
5435
5445
|
set(rpc);
|
|
@@ -8292,6 +8302,7 @@ const resize = async (uid, dimensions) => {
|
|
|
8292
8302
|
set$1(uid, instance.oldState, resizedState);
|
|
8293
8303
|
return handleResize(resizedState, dimensions);
|
|
8294
8304
|
};
|
|
8305
|
+
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
8295
8306
|
const commandMap = {
|
|
8296
8307
|
'Main.closeActiveEditor': wrapSerialCommand(closeActiveEditor),
|
|
8297
8308
|
'Main.closeAll': wrapSerialCommand(closeAll$1),
|
|
@@ -8355,7 +8366,7 @@ const commandMap = {
|
|
|
8355
8366
|
'MainArea.handleDrop': wrapSerialAsyncCommand(handleDrop),
|
|
8356
8367
|
'MainArea.handleHeaderDoubleClick': wrapSerialCommand(handleHeaderDoubleClick),
|
|
8357
8368
|
'MainArea.handleIconThemeChange': wrapSerialCommand(handleIconThemeChange),
|
|
8358
|
-
'MainArea.handleMessagePort':
|
|
8369
|
+
'MainArea.handleMessagePort': handleDirectMessagePort,
|
|
8359
8370
|
'MainArea.handleModifiedStatusChange': wrapAsyncCommand(handleModifiedStatusChangeWithContext),
|
|
8360
8371
|
'MainArea.handleResize': resize,
|
|
8361
8372
|
'MainArea.handleSashCornerPointerDown': wrapSerialCommand(handleSashCornerPointerDown),
|