@lvce-editor/ipc 7.3.0 → 8.0.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/browser.js +11 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -370,7 +370,17 @@ class IpcChildWithWindow extends Ipc {
|
|
|
370
370
|
// ignore
|
|
371
371
|
}
|
|
372
372
|
onMessage(callback) {
|
|
373
|
-
|
|
373
|
+
const wrapped = event => {
|
|
374
|
+
const {
|
|
375
|
+
ports
|
|
376
|
+
} = event;
|
|
377
|
+
if (ports.length) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
callback(event);
|
|
381
|
+
this._rawIpc.removeEventListener('message', wrapped);
|
|
382
|
+
};
|
|
383
|
+
this._rawIpc.addEventListener('message', wrapped);
|
|
374
384
|
}
|
|
375
385
|
}
|
|
376
386
|
const wrap$2 = window => {
|
package/dist/index.js
CHANGED
|
@@ -582,11 +582,12 @@ const listen$1 = ({
|
|
|
582
582
|
};
|
|
583
583
|
const getData = (event, message) => {
|
|
584
584
|
const {
|
|
585
|
-
ports
|
|
585
|
+
ports,
|
|
586
|
+
sender
|
|
586
587
|
} = event;
|
|
587
588
|
const data = {
|
|
588
589
|
...message,
|
|
589
|
-
params: [...message.params, ...ports]
|
|
590
|
+
params: [...message.params, ...ports, sender.id]
|
|
590
591
|
};
|
|
591
592
|
return data;
|
|
592
593
|
};
|