@lvce-editor/test-worker 6.0.0 → 6.1.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/testWorkerMain.js +5 -11
- package/package.json +1 -1
package/dist/testWorkerMain.js
CHANGED
|
@@ -2571,7 +2571,7 @@ const createDroppedFileHandle = async () => {
|
|
|
2571
2571
|
});
|
|
2572
2572
|
const file = await fileHandle.getFile();
|
|
2573
2573
|
// @ts-ignore
|
|
2574
|
-
const id = await
|
|
2574
|
+
const id = await invoke$1('FileSystemHandle.addFileHandle', fileHandle);
|
|
2575
2575
|
return {
|
|
2576
2576
|
file,
|
|
2577
2577
|
id
|
|
@@ -2964,11 +2964,6 @@ const getIsFirefox = () => {
|
|
|
2964
2964
|
return navigator.userAgent.toLowerCase().includes('firefox');
|
|
2965
2965
|
};
|
|
2966
2966
|
|
|
2967
|
-
/**
|
|
2968
|
-
* @type {boolean}
|
|
2969
|
-
*/
|
|
2970
|
-
const isFirefox$1 = getIsFirefox();
|
|
2971
|
-
|
|
2972
2967
|
const getNodePath$1 = () => {
|
|
2973
2968
|
// @ts-ignore
|
|
2974
2969
|
return invoke$1(/* Platform.getNodePath */'Platform.getNodePath');
|
|
@@ -2978,7 +2973,7 @@ const getNodePath = () => {
|
|
|
2978
2973
|
return getNodePath$1();
|
|
2979
2974
|
};
|
|
2980
2975
|
const isFirefox = () => {
|
|
2981
|
-
return
|
|
2976
|
+
return getIsFirefox();
|
|
2982
2977
|
};
|
|
2983
2978
|
|
|
2984
2979
|
const TestFrameWorkComponentPlatform = {
|
|
@@ -3498,6 +3493,7 @@ const getPortTuple = () => {
|
|
|
3498
3493
|
};
|
|
3499
3494
|
};
|
|
3500
3495
|
|
|
3496
|
+
// TODO ask webview worker directly
|
|
3501
3497
|
const getWebViewInfo = async webViewId => {
|
|
3502
3498
|
const info = await invoke$1('WebView.getWebViewInfo2', webViewId);
|
|
3503
3499
|
return info;
|
|
@@ -3517,7 +3513,7 @@ const waitForFirstEventEvent = async port => {
|
|
|
3517
3513
|
return firstEvent;
|
|
3518
3514
|
};
|
|
3519
3515
|
|
|
3520
|
-
const
|
|
3516
|
+
const createPortRpc = async webViewId => {
|
|
3521
3517
|
// TODO use transforpemssageportrpc
|
|
3522
3518
|
const {
|
|
3523
3519
|
port1,
|
|
@@ -3528,8 +3524,6 @@ const createPortIpc = async webViewId => {
|
|
|
3528
3524
|
const info = await getWebViewInfo(webViewId);
|
|
3529
3525
|
const portType = 'test';
|
|
3530
3526
|
await setWebViewPort(info.uid, port2, info.origin, portType);
|
|
3531
|
-
|
|
3532
|
-
// await SendPortToWebView.sendPortToWebView(webViewId, port2)
|
|
3533
3527
|
const firstEvent = await firstEventPromise;
|
|
3534
3528
|
if (firstEvent.data !== 'ready') {
|
|
3535
3529
|
throw new Error('unexpected first message');
|
|
@@ -3543,7 +3537,7 @@ const createPortIpc = async webViewId => {
|
|
|
3543
3537
|
};
|
|
3544
3538
|
|
|
3545
3539
|
const fromId = async webViewId => {
|
|
3546
|
-
const rpc = await
|
|
3540
|
+
const rpc = await createPortRpc(webViewId);
|
|
3547
3541
|
set(webViewId, rpc);
|
|
3548
3542
|
return {
|
|
3549
3543
|
locator(selector, options) {
|