plusui-native 0.2.85 → 0.2.86
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.86",
|
|
4
4
|
"description": "PlusUI CLI - Build C++ desktop apps modern UI ",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"semver": "^7.6.0",
|
|
28
28
|
"which": "^4.0.0",
|
|
29
29
|
"execa": "^8.0.1",
|
|
30
|
-
"plusui-native-builder": "^0.1.
|
|
31
|
-
"plusui-native-connect": "^0.1.
|
|
30
|
+
"plusui-native-builder": "^0.1.84",
|
|
31
|
+
"plusui-native-connect": "^0.1.84"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-connect": "^0.1.
|
|
34
|
+
"plusui-native-connect": "^0.1.84"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
@@ -27,24 +27,24 @@ function App() {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
// Listen for navigation changes
|
|
30
|
-
const
|
|
30
|
+
const unsubNav = plusui.browser.onNavigate((url) => {
|
|
31
31
|
setCurrentUrl(url);
|
|
32
32
|
plusui.browser.canGoBack().then(setCanGoBack);
|
|
33
33
|
plusui.browser.canGoForward().then(setCanGoForward);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
// Listen for responses emitted from C++ via ch.customFileDrop.emit(...) in main.cpp
|
|
37
|
-
const unsubChannel = customFileDrop.on((data: any) => {
|
|
38
|
-
setBackendMsg(data?.message ?? JSON.stringify(data));
|
|
39
|
-
});
|
|
40
|
-
|
|
41
36
|
// Get initial state
|
|
42
37
|
plusui.browser.getUrl().then(setCurrentUrl);
|
|
43
38
|
plusui.browser.canGoBack().then(setCanGoBack);
|
|
44
39
|
plusui.browser.canGoForward().then(setCanGoForward);
|
|
45
40
|
|
|
41
|
+
// Listen for responses emitted from C++ via ch.customFileDrop.emit(...) in main.cpp
|
|
42
|
+
const unsubChannel = customFileDrop.on((data: any) => {
|
|
43
|
+
setBackendMsg(data?.message ?? JSON.stringify(data));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
46
|
return () => {
|
|
47
|
-
|
|
47
|
+
unsubNav();
|
|
48
48
|
unsubChannel();
|
|
49
49
|
};
|
|
50
50
|
}, []);
|
|
@@ -23,7 +23,7 @@ function App() {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Listen for navigation changes
|
|
26
|
-
plusui.browser.onNavigate((url) => {
|
|
26
|
+
const unsubNav = plusui.browser.onNavigate((url) => {
|
|
27
27
|
setCurrentUrl(url);
|
|
28
28
|
plusui.browser.canGoBack().then(setCanGoBack);
|
|
29
29
|
plusui.browser.canGoForward().then(setCanGoForward);
|
|
@@ -35,10 +35,14 @@ function App() {
|
|
|
35
35
|
plusui.browser.canGoForward().then(setCanGoForward);
|
|
36
36
|
|
|
37
37
|
// Listen for responses emitted from C++ via ch.customFileDrop.emit(...) in main.cpp
|
|
38
|
-
const
|
|
38
|
+
const unsubFileDrop = customFileDrop.on((data: any) => {
|
|
39
39
|
setBackendMsg(data?.message ?? JSON.stringify(data));
|
|
40
40
|
});
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
onCleanup(() => {
|
|
43
|
+
unsubNav();
|
|
44
|
+
unsubFileDrop();
|
|
45
|
+
});
|
|
42
46
|
});
|
|
43
47
|
|
|
44
48
|
const handleMinimize = async () => await plusui.win.minimize();
|