@lvce-editor/extension-host-worker 5.2.0 → 5.3.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.
|
@@ -1668,7 +1668,7 @@ const registerPromise = () => {
|
|
|
1668
1668
|
promise
|
|
1669
1669
|
};
|
|
1670
1670
|
};
|
|
1671
|
-
const create$2$
|
|
1671
|
+
const create$2$2 = (method, params) => {
|
|
1672
1672
|
const {
|
|
1673
1673
|
id,
|
|
1674
1674
|
promise
|
|
@@ -1960,7 +1960,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
1960
1960
|
const {
|
|
1961
1961
|
message,
|
|
1962
1962
|
promise
|
|
1963
|
-
} = create$2$
|
|
1963
|
+
} = create$2$2(method, params);
|
|
1964
1964
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
1965
1965
|
ipc.sendAndTransfer(message);
|
|
1966
1966
|
} else {
|
|
@@ -2084,6 +2084,26 @@ const MessagePortRpcParent = {
|
|
|
2084
2084
|
__proto__: null,
|
|
2085
2085
|
create: create$8
|
|
2086
2086
|
};
|
|
2087
|
+
const create$2$1 = async ({
|
|
2088
|
+
commandMap,
|
|
2089
|
+
messagePort
|
|
2090
|
+
}) => {
|
|
2091
|
+
// TODO create a commandMap per rpc instance
|
|
2092
|
+
register$1(commandMap);
|
|
2093
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
2094
|
+
messagePort,
|
|
2095
|
+
isMessagePortOpen: true
|
|
2096
|
+
});
|
|
2097
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
2098
|
+
handleIpc(ipc);
|
|
2099
|
+
const rpc = createRpc$1(ipc);
|
|
2100
|
+
messagePort.start();
|
|
2101
|
+
return rpc;
|
|
2102
|
+
};
|
|
2103
|
+
const PlainMessagePortRpcParent = {
|
|
2104
|
+
__proto__: null,
|
|
2105
|
+
create: create$2$1
|
|
2106
|
+
};
|
|
2087
2107
|
const create$1$1 = async ({
|
|
2088
2108
|
commandMap,
|
|
2089
2109
|
webSocket
|
|
@@ -4933,6 +4953,16 @@ const handleBeforeUnload = () => {
|
|
|
4933
4953
|
// console.log('before unload')
|
|
4934
4954
|
};
|
|
4935
4955
|
|
|
4956
|
+
const handleMessagePort2 = async (port, rpcId) => {
|
|
4957
|
+
const rpc = await PlainMessagePortRpcParent.create({
|
|
4958
|
+
messagePort: port,
|
|
4959
|
+
commandMap: {}
|
|
4960
|
+
});
|
|
4961
|
+
if (rpcId) {
|
|
4962
|
+
set$9(rpcId, rpc);
|
|
4963
|
+
}
|
|
4964
|
+
};
|
|
4965
|
+
|
|
4936
4966
|
const handleMessagePort = async (port, rpcId) => {
|
|
4937
4967
|
const rpc = await MessagePortRpcClient.create({
|
|
4938
4968
|
messagePort: port,
|
|
@@ -5542,6 +5572,7 @@ const commandMap = {
|
|
|
5542
5572
|
'FileSystemMemory.writeFile': writeFile,
|
|
5543
5573
|
'HandleBeforeUnload.handleBeforeUnload': handleBeforeUnload,
|
|
5544
5574
|
'HandleMessagePort.handleMessagePort': handleMessagePort,
|
|
5575
|
+
'HandleMessagePort.handleMessagePort2': handleMessagePort2,
|
|
5545
5576
|
'IconTheme.getJson': getIconThemeJson,
|
|
5546
5577
|
'IconTheme.getState': getState,
|
|
5547
5578
|
'IconTheme.hydrate': hydrate,
|