tauri-remote-ui 0.23.0 → 0.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/api/core/index.cjs +5 -11
- package/api/core/index.js +5 -11
- package/api/event/index.cjs +8 -12
- package/api/event/index.js +8 -12
- package/package.json +4 -1
package/api/core/index.cjs
CHANGED
|
@@ -18,18 +18,12 @@ var socket = require('../../socket.cjs');
|
|
|
18
18
|
*/
|
|
19
19
|
let msg_id = 0;
|
|
20
20
|
async function invoke(cmd, args, options) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if ((window.__TAURI_INTERNALS__ && window.__TAURI_INTERNALS__.invoke) ||
|
|
25
|
-
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
26
|
-
return await core.invoke(cmd, args, options);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
throw new Error("Failed to Find Tauri handle");
|
|
30
|
-
}
|
|
21
|
+
if ((window.__TAURI_INTERNALS__ && window.__TAURI_INTERNALS__.invoke) ||
|
|
22
|
+
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
23
|
+
return await core.invoke(cmd, args, options);
|
|
31
24
|
}
|
|
32
|
-
|
|
25
|
+
else {
|
|
26
|
+
socket.initWebSocket();
|
|
33
27
|
// If WebSocket is connecting, wait for it
|
|
34
28
|
if (socket.wsReady) {
|
|
35
29
|
await socket.wsReady;
|
package/api/core/index.js
CHANGED
|
@@ -16,18 +16,12 @@ import { initWebSocket, wsReady, ws, filterCollection } from '../../socket.js';
|
|
|
16
16
|
*/
|
|
17
17
|
let msg_id = 0;
|
|
18
18
|
async function invoke(cmd, args, options) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if ((window.__TAURI_INTERNALS__ && window.__TAURI_INTERNALS__.invoke) ||
|
|
23
|
-
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
24
|
-
return await invoke$1(cmd, args, options);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
throw new Error("Failed to Find Tauri handle");
|
|
28
|
-
}
|
|
19
|
+
if ((window.__TAURI_INTERNALS__ && window.__TAURI_INTERNALS__.invoke) ||
|
|
20
|
+
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
21
|
+
return await invoke$1(cmd, args, options);
|
|
29
22
|
}
|
|
30
|
-
|
|
23
|
+
else {
|
|
24
|
+
initWebSocket();
|
|
31
25
|
// If WebSocket is connecting, wait for it
|
|
32
26
|
if (wsReady) {
|
|
33
27
|
await wsReady;
|
package/api/event/index.cjs
CHANGED
|
@@ -17,17 +17,12 @@ var socket = require('../../socket.cjs');
|
|
|
17
17
|
* @param options - Options for the event listener
|
|
18
18
|
*/
|
|
19
19
|
async function listen(event$1, handler, options) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
24
|
-
return await event.listen(event$1, handler, options);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
throw new Error("Failed to Find Tauri handle");
|
|
28
|
-
}
|
|
20
|
+
if ((window.__TAURI_INTERNALS__ && window.__TAURI_INTERNALS__.invoke) ||
|
|
21
|
+
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
22
|
+
return await event.listen(event$1, handler, options);
|
|
29
23
|
}
|
|
30
|
-
|
|
24
|
+
else {
|
|
25
|
+
socket.initWebSocket();
|
|
31
26
|
// If WebSocket is connecting, wait for it
|
|
32
27
|
if (socket.wsReady) {
|
|
33
28
|
await socket.wsReady;
|
|
@@ -42,7 +37,8 @@ async function listen(event$1, handler, options) {
|
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
catch (err) {
|
|
45
|
-
console.error(
|
|
40
|
+
console.error(err);
|
|
41
|
+
throw new Error('Error handling WebSocket event');
|
|
46
42
|
}
|
|
47
43
|
};
|
|
48
44
|
socket.ws.addEventListener('message', messageHandler);
|
|
@@ -52,7 +48,7 @@ async function listen(event$1, handler, options) {
|
|
|
52
48
|
};
|
|
53
49
|
}
|
|
54
50
|
else {
|
|
55
|
-
throw new Error(
|
|
51
|
+
throw new Error("No WebSocket or Tauri IPC available to invoke");
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
}
|
package/api/event/index.js
CHANGED
|
@@ -15,17 +15,12 @@ import { initWebSocket, wsReady, ws } from '../../socket.js';
|
|
|
15
15
|
* @param options - Options for the event listener
|
|
16
16
|
*/
|
|
17
17
|
async function listen(event, handler, options) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
22
|
-
return await listen$1(event, handler, options);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
throw new Error("Failed to Find Tauri handle");
|
|
26
|
-
}
|
|
18
|
+
if ((window.__TAURI_INTERNALS__ && window.__TAURI_INTERNALS__.invoke) ||
|
|
19
|
+
window.__TAURI__ && window.__TAURI__.invoke) {
|
|
20
|
+
return await listen$1(event, handler, options);
|
|
27
21
|
}
|
|
28
|
-
|
|
22
|
+
else {
|
|
23
|
+
initWebSocket();
|
|
29
24
|
// If WebSocket is connecting, wait for it
|
|
30
25
|
if (wsReady) {
|
|
31
26
|
await wsReady;
|
|
@@ -40,7 +35,8 @@ async function listen(event, handler, options) {
|
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
catch (err) {
|
|
43
|
-
console.error(
|
|
38
|
+
console.error(err);
|
|
39
|
+
throw new Error('Error handling WebSocket event');
|
|
44
40
|
}
|
|
45
41
|
};
|
|
46
42
|
ws.addEventListener('message', messageHandler);
|
|
@@ -50,7 +46,7 @@ async function listen(event, handler, options) {
|
|
|
50
46
|
};
|
|
51
47
|
}
|
|
52
48
|
else {
|
|
53
|
-
throw new Error(
|
|
49
|
+
throw new Error("No WebSocket or Tauri IPC available to invoke");
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tauri-remote-ui",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.24.0",
|
|
5
5
|
"author": "DraviaVemal",
|
|
6
6
|
"description": "A Tauri plugin that exposes the application's UI to a web browser, allowing full interaction while the native app continues running. This enables end-to-end UI testing using existing web-based testing tools without requiring modifications to the app itself.",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"main": "./index.cjs",
|
|
10
10
|
"module": "./index.js",
|
|
11
|
+
"repository": {
|
|
12
|
+
"url": "https://github.com/DraviaVemal/tauri-remote-ui"
|
|
13
|
+
},
|
|
11
14
|
"exports": {
|
|
12
15
|
".": {
|
|
13
16
|
"types": "./index.d.ts",
|